Bug 27912
Summary: | Set 'err' in ext4_init_fs() if kset_create_and_add() fails | ||
---|---|---|---|
Product: | File System | Reporter: | Eugene A. Shatokhin (eugene.shatokhin) |
Component: | ext4 | Assignee: | fs_ext4 (fs_ext4) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | alan, florian, tm |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.38-rc2 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Eugene A. Shatokhin
2011-01-31 20:31:30 UTC
Hi Eugene, This is already fixed by Eric. http://marc.info/?l=linux-ext4&m=129527644524410&w=2 If you can test it, that would be great. Ah, that is why there were 3 references to ext4_kset right before kset_unregister() rather than just one! Yes I will try the patch, thank you. However, it does not seem to fix the original problem I reported: 'err' remains 0 in ext4_init_fs() if kset_create_and_add() fails for some reason. I suppose it is quite easy to fix though. I have just built and tested the patched ext4.ko module. Yes, the problem with /sys/fs/ext4 is now fixed as it was expected. Obviously, the patch does not fix that problem with 'err' that I reported. So the patch probably needs to be changed a little. On Tue, Aug 14, 2012 at 03:55:52PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=27912 Actually, this wasn't quite fixed. Here's a fix which I'll include in the ext4 tree.... - Ted From b0f1e9fa10363b60334ba7837080da91de425be0 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o <tytso@mit.edu> Date: Tue, 14 Aug 2012 23:02:17 -0400 Subject: [PATCH] ext4: return an error if kset_create_and_add fails in ext4_init_fs() In the very unlikely case that kset_create_and_add() fails when the ext4.ko module is being loaded (or during kernel startup) set err so that it's clear that the module load failed. https://bugzilla.kernel.org/show_bug.cgi?id=27912 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> --- fs/ext4/super.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e7ccbe5..603023b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5281,8 +5281,10 @@ static int __init ext4_init_fs(void) if (err) goto out6; ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj); - if (!ext4_kset) + if (!ext4_kset) { + err = -ENOMEM; goto out5; + } ext4_proc_root = proc_mkdir("fs/ext4", NULL); err = ext4_init_feat_adverts(); A patch referencing this bug report has been merged in Linux v3.7-rc1: commit 0e376b1e3ccedee49cb8cc6b652fbc1e7c15eeef Author: Theodore Ts'o <tytso@mit.edu> Date: Fri Aug 17 10:04:17 2012 -0400 ext4: return an error if kset_create_and_add fails in ext4_init_fs() |