summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/overlayfs/namei.c')
-rw-r--r--fs/overlayfs/namei.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index f7fb0c919419..2d8b6292fe21 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -674,7 +674,9 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
memcpy(oe->lowerstack, stack, sizeof(struct path) * ctr);
dentry->d_fsdata = oe;
- if (index && !upperdentry)
+ if (upperdentry)
+ ovl_dentry_set_upper_alias(dentry);
+ else if (index)
upperdentry = dget(index);
if (upperdentry || ctr) {
OpenPOWER on IntegriCloud