Re: [PATCH v13 17/23] xfs: remove unwritten extents after preallocations in fsverity metadata

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-xfs,dev.linux.lists.fsverity,net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Tue, Jul 21, 2026 at 08:40:54PM +0200, Andrey Albershteyn wrote:
> +	while (offset_fsb < end_fsb) {
> +		nimaps = 1;
> +
> +		error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp);
> +		if (error)
> +			return error;
> +
> +		xfs_ilock(ip, XFS_ILOCK_EXCL);
> +		error = xfs_bmapi_read(ip, offset_fsb,
> +				end_fsb - offset_fsb, &imap, &nimaps,
> +				0);
> +		if (error)
> +			goto out_cancel;
> +
> +		if (nimaps == 0)
> +			goto out_cancel;
> +
> +		if (imap.br_state == XFS_EXT_UNWRITTEN) {

Do we also need to cancel COW fork extents here?  Should this
share code xfs_free_eofblocks by adding an end argument to that?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.