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] [thread-next>] [day] [month] [year] [list]
Message-ID: <wct2d2jrwausxgwusbnepzuegelkcl3s2veaixgrzehl6qcjyp@affaed5rinqo>
Date: Tue, 6 Jan 2026 12:25:25 +0100
From: Jan Kara <jack@...e.cz>
To: Christoph Hellwig <hch@....de>
Cc: Christian Brauner <brauner@...nel.org>, 
	Al Viro <viro@...iv.linux.org.uk>, David Sterba <dsterba@...e.com>, Jan Kara <jack@...e.cz>, 
	Mike Marshall <hubcap@...ibond.com>, Martin Brandenburg <martin@...ibond.com>, 
	Carlos Maiolino <cem@...nel.org>, Stefan Roesch <shr@...com>, Jeff Layton <jlayton@...nel.org>, 
	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>, Trond Myklebust <trondmy@...nel.org>, 
	Anna Schumaker <anna@...nel.org>, linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org, 
	linux-fsdevel@...r.kernel.org, gfs2@...ts.linux.dev, io-uring@...r.kernel.org, 
	devel@...ts.orangefs.org, linux-unionfs@...r.kernel.org, linux-mtd@...ts.infradead.org, 
	linux-xfs@...r.kernel.org, linux-nfs@...r.kernel.org
Subject: Re: [PATCH 03/11] nfs: split nfs_update_timestamps

On Tue 06-01-26 08:49:57, Christoph Hellwig wrote:
> The VFS paths update either the atime or ctime and mtime but never mix
> between atime and the others.  Split nfs_update_timestamps to match this
> to prepare for cleaning up the VFS interfaces.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/nfs/inode.c | 31 +++++++++++++++----------------
>  1 file changed, 15 insertions(+), 16 deletions(-)
> 
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index 84049f3cd340..3be8ba7b98c5 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -669,35 +669,31 @@ static void nfs_set_timestamps_to_ts(struct inode *inode, struct iattr *attr)
>  	NFS_I(inode)->cache_validity &= ~cache_flags;
>  }
>  
> -static void nfs_update_timestamps(struct inode *inode, unsigned int ia_valid)
> +static void nfs_update_atime(struct inode *inode)
>  {
> -	enum file_time_flags time_flags = 0;
> -	unsigned int cache_flags = 0;
> +	inode_update_timestamps(inode, S_ATIME);
> +	NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ATIME;
> +}
>  
> -	if (ia_valid & ATTR_MTIME) {
> -		time_flags |= S_MTIME | S_CTIME;
> -		cache_flags |= NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME;
> -	}
> -	if (ia_valid & ATTR_ATIME) {
> -		time_flags |= S_ATIME;
> -		cache_flags |= NFS_INO_INVALID_ATIME;
> -	}
> -	inode_update_timestamps(inode, time_flags);
> -	NFS_I(inode)->cache_validity &= ~cache_flags;
> +static void nfs_update_mtime(struct inode *inode)
> +{
> +	inode_update_timestamps(inode, S_MTIME | S_CTIME);
> +	NFS_I(inode)->cache_validity &=
> +		~(NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME);
>  }
>  
>  void nfs_update_delegated_atime(struct inode *inode)
>  {
>  	spin_lock(&inode->i_lock);
>  	if (nfs_have_delegated_atime(inode))
> -		nfs_update_timestamps(inode, ATTR_ATIME);
> +		nfs_update_atime(inode);
>  	spin_unlock(&inode->i_lock);
>  }
>  
>  void nfs_update_delegated_mtime_locked(struct inode *inode)
>  {
>  	if (nfs_have_delegated_mtime(inode))
> -		nfs_update_timestamps(inode, ATTR_MTIME);
> +		nfs_update_mtime(inode);
>  }
>  
>  void nfs_update_delegated_mtime(struct inode *inode)
> @@ -747,7 +743,10 @@ nfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  						ATTR_ATIME|ATTR_ATIME_SET);
>  			}
>  		} else {
> -			nfs_update_timestamps(inode, attr->ia_valid);
> +			if (attr->ia_valid & ATTR_MTIME)
> +				nfs_update_mtime(inode);
> +			if (attr->ia_valid & ATTR_ATIME)
> +				nfs_update_atime(inode);
>  			attr->ia_valid &= ~(ATTR_MTIME|ATTR_ATIME);
>  		}
>  		spin_unlock(&inode->i_lock);
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ