mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 16:01:14 +07:00
jbd2: 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: Denis 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
19b4fc52d6
commit
79da3664f6
@ -904,19 +904,10 @@ static void jbd2_stats_proc_init(journal_t *journal)
|
|||||||
snprintf(name, sizeof(name) - 1, "%s", bdevname(journal->j_dev, name));
|
snprintf(name, sizeof(name) - 1, "%s", bdevname(journal->j_dev, name));
|
||||||
journal->j_proc_entry = proc_mkdir(name, proc_jbd2_stats);
|
journal->j_proc_entry = proc_mkdir(name, proc_jbd2_stats);
|
||||||
if (journal->j_proc_entry) {
|
if (journal->j_proc_entry) {
|
||||||
struct proc_dir_entry *p;
|
proc_create_data("history", S_IRUGO, journal->j_proc_entry,
|
||||||
p = create_proc_entry("history", S_IRUGO,
|
&jbd2_seq_history_fops, journal);
|
||||||
journal->j_proc_entry);
|
proc_create_data("info", S_IRUGO, journal->j_proc_entry,
|
||||||
if (p) {
|
&jbd2_seq_info_fops, journal);
|
||||||
p->proc_fops = &jbd2_seq_history_fops;
|
|
||||||
p->data = journal;
|
|
||||||
p = create_proc_entry("info", S_IRUGO,
|
|
||||||
journal->j_proc_entry);
|
|
||||||
if (p) {
|
|
||||||
p->proc_fops = &jbd2_seq_info_fops;
|
|
||||||
p->data = journal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user