public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Brian Foster <bfoster@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	cem@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: fix XFS_ERRTAG_FORCE_ZERO_RANGE for zoned file system
Date: Wed, 10 Dec 2025 18:18:37 +0100	[thread overview]
Message-ID: <20251210171837.GA10275@lst.de> (raw)
In-Reply-To: <aTmqe3lDL2BkZe3b@bfoster>

On Wed, Dec 10, 2025 at 12:14:35PM -0500, Brian Foster wrote:
> Well yeah, it would look something like this at the current site:
> 
> 	if (!is_inode_zoned() && XFS_TEST_ERROR(...) ||
> 	    ac->reserved_blocks == magic_default_res + len)
> 		xfs_zero_range(...);
> 	else
> 		xfs_free_file_space(...);
> 
> ... and the higher level zoned code would clone the XFS_TEST_ERROR() to
> create the block reservation condition to trigger it.
> 
> Alternatively perhaps you could make that check look something like:
> 
> 	if (XFS_TEST_ERROR() && (!ac || ac->res > len))
> 		...
> 	else
> 		...
> 
> ... and let the res side always bump the res in DEBUG mode, with a
> fallback on -ENOSPC or something.

That would be less invasive for sure.  But also a bit weird, as it
encodes quite a lot of detailed knowledge of the reservations here.

I could live with it, but I fear it would have a chance to break
in not very nice ways in the future.


  reply	other threads:[~2025-12-10 17:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10  9:03 [PATCH] xfs: fix XFS_ERRTAG_FORCE_ZERO_RANGE for zoned file system Christoph Hellwig
2025-12-10 15:36 ` Brian Foster
2025-12-10 15:40   ` Christoph Hellwig
2025-12-10 17:14     ` Brian Foster
2025-12-10 17:18       ` Christoph Hellwig [this message]
2025-12-12  7:39       ` Christoph Hellwig
2025-12-12 12:24         ` Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251210171837.GA10275@lst.de \
    --to=hch@lst.de \
    --cc=bfoster@redhat.com \
    --cc=cem@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox