mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daejun Park <daejun7.park@samsung.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@kernel.org>,
	NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	Christoph Hellwig <hch@lst.de>, Carlos Maiolino <cem@kernel.org>,
	Amir Goldstein <amir73il@gmail.com>,
	Dave Chinner <dgc@kernel.org>,
	Sergey Bashirov <sergeybashirov@gmail.com>,
	Christian Brauner <brauner@kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Daejun Park <daejun7.park@samsung.com>
Subject: RE:(2) [PATCH 2/8] xfs: refuse a direct allocation whose block reservation would wrap
Date: Mon, 12 Oct 2026 11:47:45 +0900	[thread overview]
Message-ID: <20261012024745epcms2p18c4fad2aa953cd80338e2e614198a6ea@epcms2p1> (raw)
In-Reply-To: <20261008154017.GO2705364@frogsfrogsfrogs>

On Thu, Oct 08, 2026 at 08:40:17AM -0700, Darrick J. Wong wrote:
> Uh... seeing as extent records can only map 2^21 blocks maximum and
> iomap/pnfs can handle xfs returning a mapping of whatever length we
> want, why don't we constrain count_fsb to XFS_BMBT_MAX_EXTLEN?

I tried that first. It stops the wrap, but it changes what an RW
LAYOUTGET for a range longer than the free space does. Today
xfs_iomap_write_direct() reserves the whole count, so such a request
fails with -ENOSPC before anything is allocated. With the count capped,
each ->map_blocks call allocates up to 2^21 blocks, and nfsd calls it
once per extent, so the request allocates until the filesystem is full
and then fails.

On a 32 GiB XFS with nfsd-testing at the time, an RW LAYOUTGET at offset
0 of an empty file for 16 TiB, or to the end of the file, got
NFS4ERR_NOSPC with the cap, and df showed 25 GiB in use afterwards
instead of 663 MiB. The blocks stay past EOF, as each call that
allocated marked the inode XFS_DIFLAG_PREALLOC. One for 100 GiB gets
NFS4ERR_NOSPC with nothing allocated, both without this patch and with
it.

The check in this patch only refuses a count whose reservation does not
fit in an unsigned int, so a count that fits is handled as before.

  parent reply	other threads:[~2026-10-12  2:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  1:39 [PATCH 0/8] xfs, nfsd: map a whole pNFS block layout in one ->map_blocks call Daejun Park via B4 Relay
2026-10-08  1:39 ` [PATCH 1/8] xfs: map pNFS layouts to the end of the extent again Daejun Park via B4 Relay
2026-10-08  1:39 ` [PATCH 2/8] xfs: refuse a direct allocation whose block reservation would wrap Daejun Park via B4 Relay
2026-10-08 15:40   ` Darrick J. Wong
     [not found]   ` <CGME20261008154023epcas2p487b78abba35fdc6d75f9dd8d62a39837@epcms2p1>
2026-10-12  2:47     ` Daejun Park [this message]
2026-10-08  1:39 ` [PATCH 3/8] xfs: clamp the pNFS layout range to the maximum file size Daejun Park via B4 Relay
2026-10-08 15:41   ` Darrick J. Wong
2026-10-08  1:39 ` [PATCH 4/8] exportfs: let ->map_blocks return more than one mapping Daejun Park via B4 Relay
2026-10-08  1:39 ` [PATCH 5/8] xfs: factor the mapping of one pNFS extent out of xfs_fs_map_blocks() Daejun Park via B4 Relay
2026-10-08  1:39 ` [PATCH 6/8] xfs: take the invalidate lock while mapping a pNFS layout Daejun Park via B4 Relay
2026-10-08  1:39 ` [PATCH 7/8] xfs: map the whole range of a pNFS layout in one ->map_blocks call Daejun Park via B4 Relay
2026-10-08 16:37   ` Chuck Lever
     [not found]   ` <CGME20261008163812epcas2p120bb86754876aa75cd744bd63258c465@epcms2p7>
2026-10-12  2:48     ` Daejun Park
2026-10-12 14:26       ` (2) " Chuck Lever
2026-10-08  1:39 ` [PATCH 8/8] nfsd: get all extents of a block " Daejun Park via B4 Relay
2026-10-08 16:44   ` Chuck Lever
     [not found]   ` <CGME20261008164459epcas2p313b027cb2807a94a05edb388633152ed@epcms2p1>
2026-10-12  2:49     ` Daejun Park

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=20261012024745epcms2p18c4fad2aa953cd80338e2e614198a6ea@epcms2p1 \
    --to=daejun7.park@samsung.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cel@kernel.org \
    --cc=cem@kernel.org \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=sergeybashirov@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=tom@talpey.com \
    /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

all inboxes | Powered by JetHome®