summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-04-20 22:36:09 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-03 01:49:30 +0200
commit76aab3ab61f3051362f20fc26e2c50a65d6ba904 (patch)
treecba211535a3e126b192c4c8e70654d46e5f2baf3 /fs/proc
parentproc_fill_cache(): switch to d_alloc_parallel() (diff)
downloadlinux-76aab3ab61f3051362f20fc26e2c50a65d6ba904.tar.xz
linux-76aab3ab61f3051362f20fc26e2c50a65d6ba904.zip
proc_sys_fill_cache(): switch to d_alloc_parallel()
make it usable with directory locked shared Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/proc_sysctl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index fe5b6e6c4671..d69e2385862c 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -627,18 +627,19 @@ static bool proc_sys_fill_cache(struct file *file,
child = d_lookup(dir, &qname);
if (!child) {
- child = d_alloc(dir, &qname);
- if (child) {
+ DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
+ child = d_alloc_parallel(dir, &qname, &wq);
+ if (IS_ERR(child))
+ return false;
+ if (d_in_lookup(child)) {
inode = proc_sys_make_inode(dir->d_sb, head, table);
if (!inode) {
+ d_lookup_done(child);
dput(child);
return false;
- } else {
- d_set_d_op(child, &proc_sys_dentry_operations);
- d_add(child, inode);
}
- } else {
- return false;
+ d_set_d_op(child, &proc_sys_dentry_operations);
+ d_add(child, inode);
}
}
inode = d_inode(child);