aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Harkes <[email protected]>2021-11-08 18:34:42 -0800
committerLinus Torvalds <[email protected]>2021-11-09 10:02:51 -0800
commitb2e36228367a8a097c7d15670fad47d77098f56d (patch)
tree66c7a018aa85c8589ba65b976a2cad0cf94613ed
parent76097eb7a48a2ddcf4755773bd501c7aa14cbb7d (diff)
coda: avoid hidden code duplication in rename
We were actually fixing up the directory mtime in both branches after the negative dentry test, it was just that one branch was only flagging the directory inodes to refresh their attributes while the other branch used the optional optimization to set mtime to the current time and not go back to the Coda client. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jan Harkes <[email protected]> Cc: Alex Shi <[email protected]> Cc: Jing Yangyang <[email protected]> Cc: Xin Tan <[email protected]> Cc: Xiyu Yang <[email protected]> Cc: Zeal Robot <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/coda/dir.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 3fd085009f26..328d7a684b63 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -317,13 +317,10 @@ static int coda_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
coda_dir_drop_nlink(old_dir);
coda_dir_inc_nlink(new_dir);
}
- coda_dir_update_mtime(old_dir);
- coda_dir_update_mtime(new_dir);
coda_flag_inode(d_inode(new_dentry), C_VATTR);
- } else {
- coda_flag_inode(old_dir, C_VATTR);
- coda_flag_inode(new_dir, C_VATTR);
}
+ coda_dir_update_mtime(old_dir);
+ coda_dir_update_mtime(new_dir);
}
return error;
}