summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-08 09:56:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-08 09:56:38 -0700
commit4189b863ba327bac4a869773aea4995f7716945a (patch)
treeee782f30c6f92daf605172fdf22a8a683d692015
parenta94fc25b604f644ccddeb89c29b1291474bf8fe5 (diff)
parentd85b399b64e85a311c09205c675d4ae1c5af6246 (diff)
downloadlinux-4189b863ba327bac4a869773aea4995f7716945a.tar.bz2
Merge branch 'work.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull proc_fill_cache regression fix from Al Viro: "Regression fix for proc_fill_cache() braino introduced when switching instantiate() callback to d_splice_alias()" * 'work.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix proc_fill_cache() in case of d_alloc_parallel() failure
-rw-r--r--fs/proc/base.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 44dec22e5e9e..8358c5330c0b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1866,19 +1866,19 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
struct dentry *res;
res = instantiate(child, task, ptr);
d_lookup_done(child);
- if (IS_ERR(res))
- goto end_instantiate;
if (unlikely(res)) {
dput(child);
child = res;
+ if (IS_ERR(child))
+ goto end_instantiate;
}
}
}
inode = d_inode(child);
ino = inode->i_ino;
type = inode->i_mode >> 12;
-end_instantiate:
dput(child);
+end_instantiate:
return dir_emit(ctx, name, len, ino, type);
}