exfat: remove duplicate update parent dir
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Thu, 10 Nov 2022 09:38:16 +0000 (17:38 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Tue, 19 Mar 2024 11:56:10 +0000 (20:56 +0900)
For renaming, the directory only needs to be updated once if it
is in the same directory.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/namei.c

index b33497845a0608245f3e35a5fc12c231b58247f8..631ad9e8e32a913037e468a49585b0dc4006b66f 100644 (file)
@@ -1281,7 +1281,8 @@ static int exfat_rename(struct mnt_idmap *idmap,
        }
 
        inode_inc_iversion(old_dir);
-       mark_inode_dirty(old_dir);
+       if (new_dir != old_dir)
+               mark_inode_dirty(old_dir);
 
        if (new_inode) {
                exfat_unhash_inode(new_inode);