public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] [SIGNED-OFF] ext4: don't work without procfs
@ 2011-10-06 16:54 Fabrice Jouhaud
  2011-10-08 20:27 ` Ted Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Jouhaud @ 2011-10-06 16:54 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, adilger.kernel, linux-kernel, Fabrice Jouhaud

Regression from commit dd68314ccf3fb918c1fb6471817edbc60ece4b52
The problem come from the test of the return value of proc_mkdir
that is always false without procfs and abort the init of ext4.

Signed-off-by: Fabrice Jouhaud <yargil@free.fr>
---
 fs/ext4/super.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 44d0c8d..9b51b17 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4985,8 +4985,10 @@ static int __init ext4_init_fs(void)
 	if (!ext4_kset)
 		goto out6;
 	ext4_proc_root = proc_mkdir("fs/ext4", NULL);
+#ifdef CONFIG_PROC_FS
 	if (!ext4_proc_root)
 		goto out5;
+#endif
 
 	err = ext4_init_feat_adverts();
 	if (err)
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] [SIGNED-OFF] ext4: don't work without procfs
  2011-10-06 16:54 [PATCH v4] [SIGNED-OFF] ext4: don't work without procfs Fabrice Jouhaud
@ 2011-10-08 20:27 ` Ted Ts'o
  2011-10-11  9:27   ` Lukas Czerner
  0 siblings, 1 reply; 3+ messages in thread
From: Ted Ts'o @ 2011-10-08 20:27 UTC (permalink / raw)
  To: Fabrice Jouhaud; +Cc: linux-ext4, adilger.kernel, linux-kernel

On Thu, Oct 06, 2011 at 06:54:14PM +0200, Fabrice Jouhaud wrote:
> Regression from commit dd68314ccf3fb918c1fb6471817edbc60ece4b52
> The problem come from the test of the return value of proc_mkdir
> that is always false without procfs and abort the init of ext4.
> 
> Signed-off-by: Fabrice Jouhaud <yargil@free.fr>

Thanks, here's the patch that I ultimately checked in.

commit d44651d0f922b7aaeddd9fc04f2f5700a65983dd
Author: Fabrice Jouhaud <yargil@free.fr>
Date:   Sat Oct 8 16:26:03 2011 -0400

    ext4: fix ext4 so it works without CONFIG_PROC_FS
    
    This fixes a bug which was introduced in dd68314ccf3fb.  The problem
    came from the test of the return value of proc_mkdir which is always
    false without procfs, and this would initialization of ext4.
    
    Signed-off-by: Fabrice Jouhaud <yargil@free.fr>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 42f76c6..dcc4605 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3540,10 +3540,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		goto failed_mount;
 	}
 
-#ifdef CONFIG_PROC_FS
 	if (ext4_proc_root)
 		sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);
-#endif
 
 	bgl_lock_init(sbi->s_blockgroup_lock);
 
@@ -5070,13 +5068,11 @@ static int __init ext4_init_fs(void)
 		return err;
 	err = ext4_init_system_zone();
 	if (err)
-		goto out7;
+		goto out6;
 	ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
 	if (!ext4_kset)
-		goto out6;
-	ext4_proc_root = proc_mkdir("fs/ext4", NULL);
-	if (!ext4_proc_root)
 		goto out5;
+	ext4_proc_root = proc_mkdir("fs/ext4", NULL);
 
 	err = ext4_init_feat_adverts();
 	if (err)
@@ -5112,12 +5108,12 @@ out2:
 out3:
 	ext4_exit_feat_adverts();
 out4:
-	remove_proc_entry("fs/ext4", NULL);
-out5:
+	if (ext4_proc_root)
+		remove_proc_entry("fs/ext4", NULL);
 	kset_unregister(ext4_kset);
-out6:
+out5:
 	ext4_exit_system_zone();
-out7:
+out6:
 	ext4_exit_pageio();
 	return err;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] [SIGNED-OFF] ext4: don't work without procfs
  2011-10-08 20:27 ` Ted Ts'o
@ 2011-10-11  9:27   ` Lukas Czerner
  0 siblings, 0 replies; 3+ messages in thread
From: Lukas Czerner @ 2011-10-11  9:27 UTC (permalink / raw)
  To: Ted Ts'o; +Cc: Fabrice Jouhaud, linux-ext4, adilger.kernel, linux-kernel

On Sat, 8 Oct 2011, Ted Ts'o wrote:

> On Thu, Oct 06, 2011 at 06:54:14PM +0200, Fabrice Jouhaud wrote:
> > Regression from commit dd68314ccf3fb918c1fb6471817edbc60ece4b52
> > The problem come from the test of the return value of proc_mkdir
> > that is always false without procfs and abort the init of ext4.
> > 
> > Signed-off-by: Fabrice Jouhaud <yargil@free.fr>
> 
> Thanks, here's the patch that I ultimately checked in.
> 
> commit d44651d0f922b7aaeddd9fc04f2f5700a65983dd
> Author: Fabrice Jouhaud <yargil@free.fr>
> Date:   Sat Oct 8 16:26:03 2011 -0400
> 
>     ext4: fix ext4 so it works without CONFIG_PROC_FS
>     
>     This fixes a bug which was introduced in dd68314ccf3fb.  The problem
>     came from the test of the return value of proc_mkdir which is always
>     false without procfs, and this would initialization of ext4.
>     
>     Signed-off-by: Fabrice Jouhaud <yargil@free.fr>
>     Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 42f76c6..dcc4605 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3540,10 +3540,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  		goto failed_mount;
>  	}
>  
> -#ifdef CONFIG_PROC_FS
>  	if (ext4_proc_root)
>  		sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);
> -#endif
>  
>  	bgl_lock_init(sbi->s_blockgroup_lock);
>  
> @@ -5070,13 +5068,11 @@ static int __init ext4_init_fs(void)
>  		return err;
>  	err = ext4_init_system_zone();
>  	if (err)
> -		goto out7;
> +		goto out6;
>  	ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj);
>  	if (!ext4_kset)
> -		goto out6;
> -	ext4_proc_root = proc_mkdir("fs/ext4", NULL);
> -	if (!ext4_proc_root)
>  		goto out5;
> +	ext4_proc_root = proc_mkdir("fs/ext4", NULL);

Hi Ted,

I am not sure that this is very good. As I said several patch versions
back, it would be nice to print a warning in case that proc_mkdir()
fails even though procfs is compiled in. Otherwise this might hide
possible bugs.

Thanks!
-Lukas

>  
>  	err = ext4_init_feat_adverts();
>  	if (err)
> @@ -5112,12 +5108,12 @@ out2:
>  out3:
>  	ext4_exit_feat_adverts();
>  out4:
> -	remove_proc_entry("fs/ext4", NULL);
> -out5:
> +	if (ext4_proc_root)
> +		remove_proc_entry("fs/ext4", NULL);
>  	kset_unregister(ext4_kset);
> -out6:
> +out5:
>  	ext4_exit_system_zone();
> -out7:
> +out6:
>  	ext4_exit_pageio();
>  	return err;
>  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-11  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 16:54 [PATCH v4] [SIGNED-OFF] ext4: don't work without procfs Fabrice Jouhaud
2011-10-08 20:27 ` Ted Ts'o
2011-10-11  9:27   ` Lukas Czerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox