All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "frank.li@vivo.com" <frank.li@vivo.com>,
	"glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
	"slava@dubeyko.com" <slava@dubeyko.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re:  [PATCH 2/2] hfs: fix to update ctime after rename
Date: Tue, 29 Apr 2025 21:31:52 +0000	[thread overview]
Message-ID: <74bb3b5cf703ededae9b2a4a4986efe08e759876.camel@ibm.com> (raw)
In-Reply-To: <20250429201517.101323-2-frank.li@vivo.com>

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@vivo.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.


  reply	other threads:[~2025-04-29 21:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 20:15 [PATCH 1/2] hfsplus: fix to update ctime after rename Yangtao Li
2025-04-29 20:15 ` [PATCH 2/2] hfs: " Yangtao Li
2025-04-29 21:31   ` Viacheslav Dubeyko [this message]
2025-05-02  0:03   ` Viacheslav Dubeyko
2025-05-07 14:22     ` 回复: " 李扬韬
2025-05-09 17:51       ` Viacheslav Dubeyko
2025-05-09 19:02         ` Viacheslav Dubeyko
2025-05-10  5:31         ` 回复: " 李扬韬
2025-05-15  1:10           ` Viacheslav Dubeyko
2025-04-29 21:27 ` [PATCH 1/2] hfsplus: " Viacheslav Dubeyko
2025-05-01 12:01   ` 回复: " 李扬韬
2025-05-01 18:57     ` Viacheslav Dubeyko
2025-05-01 19:10       ` John Paul Adrian Glaubitz
2025-05-01 19:48         ` Viacheslav Dubeyko
2025-05-02 12:52           ` Theodore Ts'o
2025-05-05 22:31             ` Viacheslav Dubeyko
2025-05-02  0:07 ` Viacheslav Dubeyko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74bb3b5cf703ededae9b2a4a4986efe08e759876.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.