summaryrefslogtreecommitdiff
path: root/fs/overlayfs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2017-07-04 23:03:18 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2017-07-04 23:03:18 +0300
commit55acc6618259c8ff0a400a131f0f4b613e96010a (patch)
tree82f73eccca8d417ec8c77ad1b02dd28748c5c456 /fs/overlayfs/namei.c
parent23f0ab13eaa69b4a351184cbec448be2aad3a3a9 (diff)
downloadlinux-55acc6618259c8ff0a400a131f0f4b613e96010a.tar.xz
ovl: add flag for upper in ovl_entry
For rename, we need to ensure that an upper alias exists for hard links before attempting the operation. Introduce a flag in ovl_entry to track the state of the upper alias. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
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) {