Re: [PATCH v4 1/3] hfsplus: fix to update ctime after rename
From: Al Viro
Date: Tue Jul 22 2025 - 22:32:51 EST
On Tue, Jul 22, 2025 at 01:13:45AM -0600, Yangtao Li wrote:
> @@ -552,9 +553,13 @@ static int hfsplus_rename(struct mnt_idmap *idmap,
> res = hfsplus_rename_cat((u32)(unsigned long)old_dentry->d_fsdata,
> old_dir, &old_dentry->d_name,
> new_dir, &new_dentry->d_name);
> - if (!res)
> - new_dentry->d_fsdata = old_dentry->d_fsdata;
> - return res;
> + if (res)
> + return res;
> +
> + new_dentry->d_fsdata = old_dentry->d_fsdata;
Umm... Is that assignment (either before or after that patch)
actually correct?
Note that new_dentry essentially got unlinked here; old_dentry
is about to have its parent/name changed by the caller of ->rename(),
so... that looks very odd.
What is that line about?