[patch 1/4] ext4: error proc entry creation when the fs/ext4 is not correctly created

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Shen Feng <shen@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/ext4/mballoc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff -puN fs/ext4/mballoc.c~ext4-error-proc-entry-creation-when-the-fs-ext4-is-not-correctly-created fs/ext4/mballoc.c
--- a/fs/ext4/mballoc.c~ext4-error-proc-entry-creation-when-the-fs-ext4-is-not-correctly-created
+++ a/fs/ext4/mballoc.c
@@ -2785,6 +2785,10 @@ static int ext4_mb_init_per_dev_proc(str
 	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);
 
_
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux