* FAILED: patch "[PATCH] NFSv4: Prevent indefinite waits for out-of-order OPEN" failed to apply to 5.10-stable tree
@ 2026-11-25 9:15 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-11-25 9:15 UTC (permalink / raw)
To: tmenninger, anna.schumaker; +Cc: stable
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 151d95a1e696979a7d54b23c96338754be2fcc1f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026112553-underarm-mama-755d@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 151d95a1e696979a7d54b23c96338754be2fcc1f Mon Sep 17 00:00:00 2001
From: Tim Menninger <tmenninger@everpuredata.com>
Date: Fri, 30 Oct 2026 23:44:22 +0000
Subject: [PATCH] NFSv4: Prevent indefinite waits for out-of-order OPEN
stateids
When processing an out-of-order OPEN stateid on an NFSv4.1 or later
mount, nfs_set_open_stateid_locked() waits for stateid updates to be
processed in order. A five-second timeout is intended to prevent
indefinite waits when preceding updates never arrive.
However, each iteration calls schedule_timeout() with a fresh
five-second timeout. An update to the shared open state can wake the
caller without satisfying its ordering check. The remaining timeout
is then discarded, and the next iteration starts another full wait.
Under sustained concurrent OPEN/CLOSE activity on the same open state,
repeated wakeups can prevent the timeout from ever expiring. Some
tasks can remain stuck in update_open_stateid() while others continue
making progress.
Compute a single deadline on entry and pass only the remaining time
to schedule_timeout(). Once the deadline expires, take the existing
timeout path rather than starting another wait. This prevents
wakeups from extending the wait indefinitely.
Observed on Linux 6.8.0 and reproduced on 7.3.0 with 96 concurrent
O_RDWR|O_TRUNC open/close loops on one NFSv4.1/TCP file (nconnect=16).
Ten workers made no progress for over 300 seconds while others ran.
With the fix, all workers resumed after transient stalls.
Fixes: c9399f21c215 ("NFSv4: Fix OPEN / CLOSE race")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 2b01421edee7..6759fa61b9b4 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1722,6 +1722,8 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
{
DEFINE_WAIT(wait);
int status = 0;
+ unsigned long deadline = jiffies + 5 * HZ;
+ signed long remaining;
for (;;) {
if (nfs_stateid_is_sequential(state, stateid))
@@ -1756,7 +1758,8 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
if (!fatal_signal_pending(current) &&
!nfs_current_task_exiting()) {
- if (schedule_timeout(5*HZ) == 0)
+ remaining = (long)(deadline - jiffies);
+ if (remaining <= 0 || schedule_timeout(remaining) == 0)
status = -EAGAIN;
else
status = 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 9:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 9:15 FAILED: patch "[PATCH] NFSv4: Prevent indefinite waits for out-of-order OPEN" failed to apply to 5.10-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox