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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ca04c19da203d0fab27a13db9b55b22cef91dc70.camel@kernel.org>
Date: Thu, 20 Nov 2025 09:16:28 -0500
From: Jeff Layton <jlayton@...nel.org>
To: Christoph Hellwig <hch@....de>, Christian Brauner <brauner@...nel.org>
Cc: 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>, 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 16/16] xfs: enable non-blocking timestamp updates

On Thu, 2025-11-20 at 07:47 +0100, Christoph Hellwig wrote:
> The lazytime path using the generic helpers can never block in XFS
> because there is no ->dirty_inode method that could block.  Allow
> non-blocking timestamp updates for this case by replacing
> generic_update_times with the open coded version without the S_NOWAIT
> check.
> 
> Fixes: 66fa3cedf16a ("fs: Add async write file modification handling.")
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
>  fs/xfs/xfs_iops.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index bd0b7e81f6ab..57ff05be5700 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -1195,16 +1195,24 @@ xfs_vn_update_time(
>  
>  	trace_xfs_update_time(ip);
>  
> -	if (flags & S_NOWAIT)
> -		return -EAGAIN;
> -
>  	if (inode->i_sb->s_flags & SB_LAZYTIME) {
> -		if (!((flags & S_VERSION) &&
> -		      inode_maybe_inc_iversion(inode, false)))
> -			return generic_update_time(inode, flags);

I especially like getting this inode_maybe_inc_iversion() out of this
function.

> +		int updated = flags;
> +
> +		error = inode_update_timestamps(inode, &updated);
> +		if (error)
> +			return error;
> +
> +		if (!(updated & S_VERSION)) {
> +			if (updated)
> +				mark_inode_dirty_time(inode, updated);
> +			return 0;
> +		}
>  
>  		/* Capture the iversion update that just occurred */
>  		log_flags |= XFS_ILOG_CORE;
> +	} else {
> +		if (flags & S_NOWAIT)
> +			return -EAGAIN;
>  	}
>  
>  	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);

Reviewed-by: Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ