mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daejun Park <daejun7.park@samsung.com>
To: Chuck Lever <cel@kernel.org>
Cc: 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>,
	Benjamin Coddington <bcodding@redhat.com>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Daejun Park <daejun7.park@samsung.com>
Subject: RE:(2) [PATCH 0/6] nfsd: layout recall and lease break fixes
Date: Wed, 07 Oct 2026 11:10:56 +0900	[thread overview]
Message-ID: <20261007021056epcms2p180289a2c55fd8e5efb8153d8aba43919@epcms2p1> (raw)
In-Reply-To: <63ef8d7c-086f-4cc8-84bb-72c1b23bf596@slotpi15m67>

On Tue, Oct 06, 2026 at 03:46:40PM -0400, Chuck Lever wrote:
> I think the fix has to come first. Before the WRITE or SETATTR, call
> break_layout() non-blocking to start the recall, and return
> NFS4ERR_DELAY on -EWOULDBLOCK, as we do for delegations. Then the
> fence worker and the poll loop can take as long as they need and no
> nfsd thread waits on them.

Agreed, I will put that patch first in v2. Besides WRITE and SETATTR
with a size, XFS breaks layouts in fallocate and in remap, where
xfs_iolock_two_inodes_and_break_layout() waits on the source file as
well, so ALLOCATE, DEALLOCATE, CLONE and COPY will be checked too, the
last two on both files.

That also covers a wait that is unbounded today. For the SCSI layout,
when fencing keeps failing, the fence worker retries without limit and
nfsd4_layout_lm_breaker_timedout() returns false while it is in flight,
so the thread in __break_lease() keeps waiting (read from the code, not
run).

Two things I will test and report with v2:

- The check in nfsd and the break_layout() in XFS are not atomic. A
  LAYOUTGET granted between them still puts the thread to sleep in
  xfs_break_leased_layouts(). No new layout lease is granted while a
  recall is in progress, so this needs a layout granted when none was
  held at the check.

- A writer going through the MDS now retries after NFS4ERR_DELAY
  instead of waking up when the layout is returned, so a client that
  keeps getting new layouts could starve it.

Daejun

      parent reply	other threads:[~2026-10-07  2:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  4:29 Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 1/6] nfsd: make the time limit of a layout recall work Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 2/6] nfsd: run the fence script when a block layout lease break times out Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 3/6] nfsd: keep polling a layout recall answered with NFS4ERR_OLD_STATEID Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 4/6] nfsd: fail a LAYOUTGET in progress when the layout lease is broken Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 5/6] nfsd: poll a layout recall with a new seqid when the client is past it Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 6/6] nfsd: do not fence a client for a layout recall with no layouts left Daejun Park via B4 Relay
2026-10-06 19:46 ` [PATCH 0/6] nfsd: layout recall and lease break fixes Chuck Lever
     [not found] ` <CGME20261006194708epcas2p2df158d7a6f0f9eb57cf1f6c3a0ec0c4b@epcms2p1>
2026-10-07  2:10   ` Daejun Park [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=20261007021056epcms2p180289a2c55fd8e5efb8153d8aba43919@epcms2p1 \
    --to=daejun7.park@samsung.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=bcodding@redhat.com \
    --cc=cel@kernel.org \
    --cc=hch@lst.de \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@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

all inboxes | Powered by JetHome®