summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-04-20 16:31:31 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-02 19:49:29 -0400
commit3781764b5cb109152af180a4f17cd3a24d5bc51f (patch)
treedfd7482d959625031f5afb2c5a41b446f2001fc6 /fs/proc
parent6192269444ebfbfb42e23c7a6a93c76ffe4b5e51 (diff)
downloadop-kernel-dev-3781764b5cb109152af180a4f17cd3a24d5bc51f.zip
op-kernel-dev-3781764b5cb109152af180a4f17cd3a24d5bc51f.tar.gz
proc_fill_cache(): switch to d_alloc_parallel()
... making 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/base.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b1755b2..15b60f1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1819,12 +1819,17 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
child = d_hash_and_lookup(dir, &qname);
if (!child) {
- child = d_alloc(dir, &qname);
- if (!child)
- goto end_instantiate;
- if (instantiate(d_inode(dir), child, task, ptr) < 0) {
- dput(child);
+ DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
+ child = d_alloc_parallel(dir, &qname, &wq);
+ if (IS_ERR(child))
goto end_instantiate;
+ if (d_in_lookup(child)) {
+ int err = instantiate(d_inode(dir), child, task, ptr);
+ d_lookup_done(child);
+ if (err < 0) {
+ dput(child);
+ goto end_instantiate;
+ }
}
}
inode = d_inode(child);
OpenPOWER on IntegriCloud