Commit 46fe74f2 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by Linus Torvalds
Browse files

ext4: use non-racy method for proc entries creation



Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Cc: <linux-ext4@vger.kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 21ac295b
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -2449,17 +2449,10 @@ static void ext4_mb_history_init(struct super_block *sb)
	int i;

	if (sbi->s_mb_proc != NULL) {
		struct proc_dir_entry *p;
		p = create_proc_entry("mb_history", S_IRUGO, sbi->s_mb_proc);
		if (p) {
			p->proc_fops = &ext4_mb_seq_history_fops;
			p->data = sb;
		}
		p = create_proc_entry("mb_groups", S_IRUGO, sbi->s_mb_proc);
		if (p) {
			p->proc_fops = &ext4_mb_seq_groups_fops;
			p->data = sb;
		}
		proc_create_data("mb_history", S_IRUGO, sbi->s_mb_proc,
				 &ext4_mb_seq_history_fops, sb);
		proc_create_data("mb_groups", S_IRUGO, sbi->s_mb_proc,
				 &ext4_mb_seq_groups_fops, sb);
	}

	sbi->s_mb_history_max = 1000;