lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0f96f555b85457d179f474718010e433498d563b.camel@ibm.com>
Date: Fri, 30 May 2025 16:33:19 +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 v3 3/3] hfs: fix to update ctime after rename

On Fri, 2025-05-30 at 02:17 -0600, Yangtao Li wrote:
> Similar to hfsplus, let's update file ctime after the rename operation
> in hfs_rename().
> 
> W/O patch(xfstest generic/003):
> 
>  +ERROR: access time has not been updated after accessing file1 first time
>  +ERROR: access time has not been updated after accessing file2
>  +ERROR: access time has changed after modifying file1
>  +ERROR: change time has not been updated after changing file1
>  +ERROR: access time has not been updated after accessing file3 second time
>  +ERROR: access time has not been updated after accessing file3 third time
> 
> W/ patch(xfstest generic/003):
> 
>  +ERROR: access time has not been updated after accessing file1 first time
>  +ERROR: access time has not been updated after accessing file2
>  +ERROR: access time has changed after modifying file1
>  +ERROR: access time has not been updated after accessing file3 second time
>  +ERROR: access time has not been updated after accessing file3 third time
> 

I still don't understand this comment. What does finally this patch fix?

Thanks,
Slava.

> Signed-off-by: Yangtao Li <frank.li@...o.com>
> ---
>  fs/hfs/dir.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
> index 86a6b317b474..756ea7b895e2 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)
> @@ -296,14 +297,16 @@ static int hfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
>  			return res;
>  	}
>  
> -	res = hfs_cat_move(d_inode(old_dentry)->i_ino,
> -			   old_dir, &old_dentry->d_name,
> +	res = hfs_cat_move(inode->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(inode)->cat_key,
> +			  new_dir->i_ino, &new_dentry->d_name);
> +	inode_set_ctime_current(inode);
> +	mark_inode_dirty(inode);
> +	return 0;
>  }
>  
>  const struct file_operations hfs_dir_operations = {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ