Skip to contentSkip to conversation

ocfs2: fix return value set in init_dlmfs_fs()

PATCH New Coly Li 3 participants 3 messages Nov 17, 2008 – Nov 19, 2008 OCFS2

lore
Share & tools
lore

Coly Li

author
#0 lore raw

PATCH 1/1 ocfs2: fix return value set in init_dlmfs_fs()

In init_dlmfs_fs(), if calling kmem_cache_create() failed, the code will use return value from calling bdi_init(). The correct behavior should be set status as -ENOMEM before going to "bail:".

---
 fs/ocfs2/dlm/dlmfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/ocfs2/dlm/dlmfs.c +3 -1
index 533a789..ba962d7 100644
@@ -608,8 +608,10 @@ static int __init init_dlmfs_fs(void)
 				0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
 					SLAB_MEM_SPREAD),
 				dlmfs_init_once);
-	if (!dlmfs_inode_cache)
+	if (!dlmfs_inode_cache) {
+		status = -ENOMEM;
 		goto bail;
+	}
 	cleanup_inode = 1;
 
 	user_dlm_worker = create_singlethread_workqueue("user_dlm");
Signature · 2 lines
Coly Li
SuSE PRC Labs
#1 lore raw

PATCH 1/1 ocfs2: fix return value set in init_dlmfs_fs()

Quoted 26 lines · Coly Li

In init_dlmfs_fs(), if calling kmem_cache_create() failed, the code will use return value from calling bdi_init(). The correct behavior should be set status as -ENOMEM before going to "bail:".

---
 fs/ocfs2/dlm/dlmfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/ocfs2/dlm/dlmfs.c +3 -1
index 533a789..ba962d7 100644
@@ -608,8 +608,10 @@ static int __init init_dlmfs_fs(void)
 				0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
 					SLAB_MEM_SPREAD),
 				dlmfs_init_once);
-	if (!dlmfs_inode_cache)
+	if (!dlmfs_inode_cache) {
+		status = -ENOMEM;
 		goto bail;
+	}
 	cleanup_inode = 1;
 
 	user_dlm_worker = create_singlethread_workqueue("user_dlm");
#2 lore raw

PATCH 1/1 ocfs2: fix return value set in init_dlmfs_fs()

In reply to Coly Li
Quoted 2 lines · Coly Li

In init_dlmfs_fs(), if calling kmem_cache_create() failed, the code will use return value from calling bdi_init(). The correct behavior should be set status as -ENOMEM before going to "bail:".

Thanks, this is in ocfs2.git now.

	--Mark

--
Mark Fasheh