From ea849cf36cfa1f3d17f7d82a02fea9d0dd4cf981 Mon Sep 17 00:00:00 2001 From: Yuezhang Mo Date: Sat, 30 Dec 2023 00:30:41 +0900 Subject: [PATCH] exfat: remove duplicate update parent dir For renaming, the directory only needs to be updated once if it is in the same directory. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Signed-off-by: Namjae Jeon --- namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/namei.c b/namei.c index c425c3b..8647a57 100644 --- a/namei.c +++ b/namei.c @@ -1385,7 +1385,8 @@ static int exfat_rename(struct user_namespace *mnt_userns, #if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 6, 0) old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); #endif - mark_inode_dirty(old_dir); + if (new_dir != old_dir) + mark_inode_dirty(old_dir); if (new_inode) { exfat_unhash_inode(new_inode);