Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <frank.li@vivo.com>
Tested-by: Viacheslav Dubeyko <slava@dubeyko.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/linux-fsdevel/20250530081719.2430291-1-frank.li@vivo.com/
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>

+13 -2
+13 -2
fs/hfsplus/dir.c
··· 603 603 old_dir, &old_dentry->d_name, 604 604 new_dir, &new_dentry->d_name); 605 605 if (!res) { 606 + struct inode *inode = d_inode(old_dentry); 607 + 606 608 new_dentry->d_fsdata = old_dentry->d_fsdata; 607 609 610 + inode_set_ctime_current(inode); 611 + mark_inode_dirty(inode); 612 + 608 613 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); 611 622 } 612 623 return res; 613 624 }