diff mbox series

[v3,10/10] exfat: remove duplicate update parent dir

Message ID TY0PR04MB63289A9B7B7B93685255DACB81242@TY0PR04MB6328.apcprd04.prod.outlook.com (mailing list archive)
State New
Headers show
Series [v3,01/10] exfat: add __exfat_get_dentry_set() helper | expand

Commit Message

Yuezhang.Mo@sony.com March 11, 2024, 4:25 a.m. UTC
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>
---
 fs/exfat/namei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index b33497845a06..631ad9e8e32a 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -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);