From 3635d000f04b709c575bfbe5c6d1f0e1c0135fa1 Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Tue, 23 Jan 2024 17:05:35 +0100 Subject: [PATCH 1/2] fs/orangefs: remove ORANGEFS_CACHE_CREATE_FLAGS The flags were set to SLAB_RED_ZONE when CONFIG_DEBUG_SLAB was enabled. With SLAB gone, this is now dead code so remove it. With SLUB, debugging options including red zoning can be set for orangefs caches by the slab_debug boot parameter. Signed-off-by: Vlastimil Babka Signed-off-by: Mike Marshall --- fs/orangefs/orangefs-cache.c | 2 +- fs/orangefs/orangefs-kernel.h | 10 ---------- fs/orangefs/super.c | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/fs/orangefs/orangefs-cache.c b/fs/orangefs/orangefs-cache.c index 3b6982bf6bcf..e75e173a9186 100644 --- a/fs/orangefs/orangefs-cache.c +++ b/fs/orangefs/orangefs-cache.c @@ -22,7 +22,7 @@ int op_cache_initialize(void) op_cache = kmem_cache_create("orangefs_op_cache", sizeof(struct orangefs_kernel_op_s), 0, - ORANGEFS_CACHE_CREATE_FLAGS, + 0, NULL); if (!op_cache) { diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 926d9c0a428a..e2df7eeadc7a 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -93,16 +93,6 @@ enum orangefs_vfs_op_states { OP_VFS_STATE_GIVEN_UP = 16, }; -/* - * orangefs kernel memory related flags - */ - -#if (defined CONFIG_DEBUG_SLAB) -#define ORANGEFS_CACHE_CREATE_FLAGS SLAB_RED_ZONE -#else -#define ORANGEFS_CACHE_CREATE_FLAGS 0 -#endif - extern const struct xattr_handler * const orangefs_xattr_handlers[]; extern struct posix_acl *orangefs_get_acl(struct inode *inode, int type, bool rcu); diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index 5254256a224d..d5a71df63d4e 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -644,7 +644,7 @@ int orangefs_inode_cache_initialize(void) "orangefs_inode_cache", sizeof(struct orangefs_inode_s), 0, - ORANGEFS_CACHE_CREATE_FLAGS, + 0, offsetof(struct orangefs_inode_s, link_target), sizeof_field(struct orangefs_inode_s, From 9bf93dcfc453fae192fe5d7874b89699e8f800ac Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Wed, 14 Feb 2024 15:57:53 -0500 Subject: [PATCH 2/2] Julia Lawall reported this null pointer dereference, this should fix it. Signed-off-by: Mike Marshall --- fs/orangefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index d5a71df63d4e..34849b4a3243 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -527,7 +527,7 @@ struct dentry *orangefs_mount(struct file_system_type *fst, sb->s_fs_info = kzalloc(sizeof(struct orangefs_sb_info_s), GFP_KERNEL); if (!ORANGEFS_SB(sb)) { d = ERR_PTR(-ENOMEM); - goto free_sb_and_op; + goto free_op; } ret = orangefs_fill_sb(sb,