Skip to contentSkip to conversation

ext4: error proc entry creation when the fs/ext4 is not correctly created

PATCH New Shen Feng 1 participant 1 message May 16, 2008 ext4 file system

lore
Share & tools
lore

Shen Feng

author
#0 lore raw

PATCH 1/1 ext4: error proc entry creation when the fs/ext4 is not correctly created

When the directory fs/ext4 is not correctly created under proc, the entry under this directory should not be created.

---
 fs/ext4/mballoc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ext4/mballoc.c +4 -0
index b128bdc..3c616f2 100644
@@ -2639,6 +2639,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);
 
Signature · 1 line
1.5.4.1