diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-11-01 17:33:13 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-11-09 10:23:27 +0100 |
commit | f30536f0f955d9d3eb5a7e32033af4e3649de173 (patch) | |
tree | 4eef3f04a4dec1b51ca66f255eb0d8aae4f071a6 /fs/overlayfs/dir.c | |
parent | a0c5ad307ac09fa1c73b57bfd94f4c3fd6ba92d8 (diff) | |
download | linux-f30536f0f955d9d3eb5a7e32033af4e3649de173.tar.gz linux-f30536f0f955d9d3eb5a7e32033af4e3649de173.tar.bz2 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.c | 7 |
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); |