[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <74bb3b5cf703ededae9b2a4a4986efe08e759876.camel@ibm.com>
Date: Tue, 29 Apr 2025 21:31:52 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "frank.li@...o.com" <frank.li@...o.com>,
"glaubitz@...sik.fu-berlin.de"
<glaubitz@...sik.fu-berlin.de>,
"slava@...eyko.com" <slava@...eyko.com>
CC: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] hfs: fix to update ctime after rename
On Tue, 2025-04-29 at 14:15 -0600, Yangtao Li wrote:
> Similar to hfsplus, let's update file ctime after the rename operation
> in hfs_rename().
>
It will be good to see which HFS test-case fails in the comment.
> Signed-off-by: Yangtao Li <frank.li@...o.com>
> ---
> fs/hfs/dir.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
> index 86a6b317b474..3b95bafb3f04 100644
> --- a/fs/hfs/dir.c
> +++ b/fs/hfs/dir.c
> @@ -284,6 +284,7 @@ static int hfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
> struct dentry *old_dentry, struct inode *new_dir,
> struct dentry *new_dentry, unsigned int flags)
> {
> + struct inode *inode = d_inode(old_dentry);
> int res;
>
> if (flags & ~RENAME_NOREPLACE)
> @@ -299,11 +300,15 @@ static int hfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
> res = hfs_cat_move(d_inode(old_dentry)->i_ino,
> old_dir, &old_dentry->d_name,
> new_dir, &new_dentry->d_name);
> - if (!res)
> - hfs_cat_build_key(old_dir->i_sb,
> - (btree_key *)&HFS_I(d_inode(old_dentry))->cat_key,
> - new_dir->i_ino, &new_dentry->d_name);
> - return res;
> + if (res)
> + return res;
> +
> + hfs_cat_build_key(old_dir->i_sb,
> + (btree_key *)&HFS_I(d_inode(old_dentry))->cat_key,
> + new_dir->i_ino, &new_dentry->d_name);
> + inode_set_ctime_current(inode);
> + mark_inode_dirty(inode);
> + return 0;
> }
>
Unfortunately, I cannot apply this patch too. Could you please prepare the patch
for the latest kernel tree state?
Thanks,
Slava.
Powered by blists - more mailing lists