summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/dir.c
diff options
context:
space:
mode:
authorAmir Goldstein2017-11-01 16:33:13 +0100
committerMiklos Szeredi2017-11-09 10:23:27 +0100
commitf30536f0f955d9d3eb5a7e32033af4e3649de173 (patch)
tree4eef3f04a4dec1b51ca66f255eb0d8aae4f071a6 /fs/overlayfs/dir.c
parentovl: relax same fs constraint for constant st_ino (diff)
downloadkernel-qcow2-linux-f30536f0f955d9d3eb5a7e32033af4e3649de173.tar.gz
kernel-qcow2-linux-f30536f0f955d9d3eb5a7e32033af4e3649de173.tar.xz
kernel-qcow2-linux-f30536f0f955d9d3eb5a7e32033af4e3649de173.zip
ovl: update cache version of impure parent on rename
ovl_rename() updates dir cache version for impure old parent if an entry with copy up origin is moved into old parent, but it did not update cache version if the entry moved out of old parent has a copy up origin. [SzM] Same for new dir: we updated the version if an entry with origin was moved in, but not if an entry with origin was moved out. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/dir.c')
-rw-r--r--fs/overlayfs/dir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index ef533198be45..e13921824c70 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -1075,9 +1075,10 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
drop_nlink(d_inode(new));
}
- ovl_dentry_version_inc(old->d_parent,
- !overwrite && ovl_type_origin(new));
- ovl_dentry_version_inc(new->d_parent, ovl_type_origin(old));
+ ovl_dentry_version_inc(old->d_parent, ovl_type_origin(old) ||
+ (!overwrite && ovl_type_origin(new)));
+ ovl_dentry_version_inc(new->d_parent, ovl_type_origin(old) ||
+ (d_inode(new) && ovl_type_origin(new)));
out_dput:
dput(newdentry);