[PATCH 5/9] coda: Avoid hidden code duplication in rename.

From
Jan Harkes <jaharkes@cs.cmu.edu>
Date
2021-09-08 14:29:16
Reply to
Jan Harkes, 2021-09-08
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.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
---
 fs/coda/dir.c | 7 ++-----
 1 file 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;
 }
-- 
2.25.1
Thread (10 messages) 10 messages, 1 author, last reply 2021-09-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help