ext4: error proc entry creation when the fs/ext4 is not correctly created
authorShen Feng <shen@cn.fujitsu.com>
Mon, 14 Jul 2008 01:03:31 +0000 (21:03 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Jul 2008 01:03:31 +0000 (21:03 -0400)
When the directory fs/ext4 is not correctly created under proc, the entry
under this directory should not be created.

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c

index 21ee6d42ee7b91a740d2fcf9d47acfe5a4dfc01e..771a1d60852886682a9a98a807ab7051e66db453 100644 (file)
@@ -2661,6 +2661,10 @@ static int ext4_mb_init_per_dev_proc(struct super_block *sb)
        struct proc_dir_entry *proc;
        char devname[64];
 
+       if (proc_root_ext4 == NULL) {
+               sbi->s_mb_proc = NULL;
+               return -EINVAL;
+       }
        bdevname(sb->s_bdev, devname);
        sbi->s_mb_proc = proc_mkdir(devname, proc_root_ext4);