Skip to content

Commit b099ed5

Browse files
committed
hfsplus: fix to update ctime after rename
[BUG] $ sudo ./check generic/003 FSTYP -- hfsplus PLATFORM -- Linux/x86_64 graphic 6.8.0-58-generic #60~22.04.1-Ubuntu MKFS_OPTIONS -- /dev/loop29 MOUNT_OPTIONS -- /dev/loop29 /mnt/scratch generic/003 - output mismatch --- tests/generic/003.out 2025-04-27 08:49:39.876945323 -0600 +++ /home/graphic/fs/xfstests-dev/results//generic/003.out.bad QA output created by 003 +ERROR: change time has not been updated after changing file1 Silence is golden ... Ran: generic/003 Failures: generic/003 Failed 1 of 1 tests [CAUSE] change time has not been updated after changing file1 [FIX] Update file ctime after rename in hfsplus_rename(). Signed-off-by: Yangtao Li <[email protected]> Tested-by: Viacheslav Dubeyko <[email protected]> Reviewed-by: Viacheslav Dubeyko <[email protected]> Link: https://lore.kernel.org/linux-fsdevel/[email protected]/ Signed-off-by: Viacheslav Dubeyko <[email protected]>
1 parent a46aaa7 commit b099ed5

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

fs/hfsplus/dir.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,22 @@ static int hfsplus_rename(struct mnt_idmap *idmap,
603603
old_dir, &old_dentry->d_name,
604604
new_dir, &new_dentry->d_name);
605605
if (!res) {
606+
struct inode *inode = d_inode(old_dentry);
607+
606608
new_dentry->d_fsdata = old_dentry->d_fsdata;
607609

610+
inode_set_ctime_current(inode);
611+
mark_inode_dirty(inode);
612+
608613
res = hfsplus_cat_write_inode(old_dir);
609-
if (!res)
610-
res = hfsplus_cat_write_inode(new_dir);
614+
if (res)
615+
return res;
616+
617+
res = hfsplus_cat_write_inode(new_dir);
618+
if (res)
619+
return res;
620+
621+
res = hfsplus_cat_write_inode(inode);
611622
}
612623
return res;
613624
}

0 commit comments

Comments
 (0)