From: Christoph Hellwig <hch@lst.de>
To: daejun7.park@samsung.com
Cc: Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org, "Darrick J. Wong" <djwong@kernel.org>,
Dave Chinner <dgc@kernel.org>, Christoph Hellwig <hch@lst.de>,
Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@kernel.org>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] xfs: punch delalloc blocks past EOF before mapping a pNFS layout
Date: Mon, 30 Nov 2026 14:02:06 +0100 [thread overview]
Message-ID: <20261130130206.GA28398@lst.de> (raw)
In-Reply-To: <20261126-xfs-pnfs-delalloc-eof-v1-1-509deb79a255@samsung.com>
On Thu, Nov 26, 2026 at 10:45:47AM +0900, Daejun Park via B4 Relay wrote:
> @@ -192,6 +193,18 @@ xfs_fs_map_blocks(
> if (WARN_ON_ONCE(error))
> goto out_unlock;
>
> + /*
> + * Writeback stops allocating a delalloc extent once the page it writes
> + * is covered, so speculative preallocation past EOF can stay delalloc.
> + * Delalloc past EOF never holds data. Punch all of it, as
> + * xfs_free_eofblocks() does for preallocated files, so that a layout
> + * never maps it and a LAYOUTCOMMIT never moves EOF over it.
> + */
> + if (ip->i_delayed_blks)
> + xfs_bmap_punch_delalloc_range(ip, XFS_DATA_FORK,
> + round_up(XFS_ISIZE(ip), mp->m_sb.sb_blocksize),
> + LLONG_MAX, NULL);
> +
This is basically a xfs_free_eofblocks. I think we also should do a
xfs_inode_clear_eofblocks_tag here, and we also need to do a
inode_dio_wait to settle i_size after taking the iolock.
prev parent reply other threads:[~2026-11-30 13:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 1:45 [PATCH] xfs: punch delalloc blocks past EOF before mapping a pNFS layout Daejun Park via B4 Relay
2026-11-26 1:45 ` Daejun Park
2026-11-30 13:02 ` Christoph Hellwig [this message]
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=20261130130206.GA28398@lst.de \
--to=hch@lst.de \
--cc=cel@kernel.org \
--cc=cem@kernel.org \
--cc=daejun7.park@samsung.com \
--cc=dgc@kernel.org \
--cc=djwong@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.