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: <20240827160353.GT865349@frogsfrogsfrogs>
Date: Tue, 27 Aug 2024 09:03:53 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: Christoph Hellwig <hch@....de>
Cc: Christian Brauner <brauner@...nel.org>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Chandan Babu R <chandan.babu@...cle.com>,
	Brian Foster <bfoster@...hat.com>, Jens Axboe <axboe@...nel.dk>,
	Jan Kara <jack@...e.cz>, Theodore Ts'o <tytso@....edu>,
	linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-xfs@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 5/6] xfs: move the xfs_is_always_cow_inode check into
 xfs_alloc_file_space

On Tue, Aug 27, 2024 at 08:50:49AM +0200, Christoph Hellwig wrote:
> Move the xfs_is_always_cow_inode check from the caller into
> xfs_alloc_file_space to prepare for refactoring of xfs_file_fallocate.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>

Reviewed-by: Darrick J. Wong <djwong@...nel.org>

--D

> ---
>  fs/xfs/xfs_bmap_util.c | 3 +++
>  fs/xfs/xfs_file.c      | 8 +++-----
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 187a0dbda24fc4..e9fdebaa40ea59 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -653,6 +653,9 @@ xfs_alloc_file_space(
>  	xfs_bmbt_irec_t		imaps[1], *imapp;
>  	int			error;
>  
> +	if (xfs_is_always_cow_inode(ip))
> +		return 0;
> +
>  	trace_xfs_alloc_file_space(ip);
>  
>  	if (xfs_is_shutdown(mp))
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 5b9e49da06013c..489bc1b173c268 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -987,11 +987,9 @@ xfs_file_fallocate(
>  			}
>  		}
>  
> -		if (!xfs_is_always_cow_inode(ip)) {
> -			error = xfs_alloc_file_space(ip, offset, len);
> -			if (error)
> -				goto out_unlock;
> -		}
> +		error = xfs_alloc_file_space(ip, offset, len);
> +		if (error)
> +			goto out_unlock;
>  	}
>  
>  	/* Change file size if needed */
> -- 
> 2.43.0
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ