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>
This commit is contained in:
Amir Goldstein 2017-11-01 17:33:13 +02:00 committed by Miklos Szeredi
parent a0c5ad307a
commit f30536f0f9

View File

@ -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);