* [PATCH nfsd-next] nfsd: fix uninitialised slot info when a request is retried
@ 2025-01-27 23:05 NeilBrown
2025-01-28 11:16 ` Jeff Layton
2025-01-28 14:40 ` cel
0 siblings, 2 replies; 3+ messages in thread
From: NeilBrown @ 2025-01-27 23:05 UTC (permalink / raw)
To: Chuck Lever, Jeff Layton; +Cc: linux-nfs
A recent patch moved the assignment of seq->maxslots from before the
test for a resent request (which ends with a goto) to after, resulting
in it not being run in that case. This results in the server returning
bogus "high slot id" and "target high slot id" values.
The assignments to ->maxslots and ->target_maxslots need to be *after*
the out: label so that the correct values are returned in replies to
requests that are served from cache.
Fixes: 60aa6564317d ("nfsd: allocate new session-based DRC slots on demand.")
Signed-off-by: NeilBrown <neilb@suse.de>
---
Feel free to squash this into the offending patch, though subsequent
patches will need to be refreshed carefully. Or just add it as-is.
Thanks.
fs/nfsd/nfs4state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index cc819b8e8acd..b42e2ab7a042 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4460,10 +4460,11 @@ nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
}
} while (slot && --cnt > 0);
}
+
+out:
seq->maxslots = max(session->se_target_maxslots, seq->maxslots);
seq->target_maxslots = session->se_target_maxslots;
-out:
switch (clp->cl_cb_state) {
case NFSD4_CB_DOWN:
seq->status_flags = SEQ4_STATUS_CB_PATH_DOWN;
base-commit: c1d6e5f7635895b5e9b2e4a9e4b7cdb9cc07eaf7
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nfsd-next] nfsd: fix uninitialised slot info when a request is retried
2025-01-27 23:05 [PATCH nfsd-next] nfsd: fix uninitialised slot info when a request is retried NeilBrown
@ 2025-01-28 11:16 ` Jeff Layton
2025-01-28 14:40 ` cel
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2025-01-28 11:16 UTC (permalink / raw)
To: NeilBrown, Chuck Lever; +Cc: linux-nfs
On Tue, 2025-01-28 at 10:05 +1100, NeilBrown wrote:
> A recent patch moved the assignment of seq->maxslots from before the
> test for a resent request (which ends with a goto) to after, resulting
> in it not being run in that case. This results in the server returning
> bogus "high slot id" and "target high slot id" values.
>
> The assignments to ->maxslots and ->target_maxslots need to be *after*
> the out: label so that the correct values are returned in replies to
> requests that are served from cache.
>
> Fixes: 60aa6564317d ("nfsd: allocate new session-based DRC slots on demand.")
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>
> Feel free to squash this into the offending patch, though subsequent
> patches will need to be refreshed carefully. Or just add it as-is.
> Thanks.
>
> fs/nfsd/nfs4state.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index cc819b8e8acd..b42e2ab7a042 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4460,10 +4460,11 @@ nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> }
> } while (slot && --cnt > 0);
> }
> +
> +out:
> seq->maxslots = max(session->se_target_maxslots, seq->maxslots);
> seq->target_maxslots = session->se_target_maxslots;
>
> -out:
> switch (clp->cl_cb_state) {
> case NFSD4_CB_DOWN:
> seq->status_flags = SEQ4_STATUS_CB_PATH_DOWN;
>
> base-commit: c1d6e5f7635895b5e9b2e4a9e4b7cdb9cc07eaf7
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nfsd-next] nfsd: fix uninitialised slot info when a request is retried
2025-01-27 23:05 [PATCH nfsd-next] nfsd: fix uninitialised slot info when a request is retried NeilBrown
2025-01-28 11:16 ` Jeff Layton
@ 2025-01-28 14:40 ` cel
1 sibling, 0 replies; 3+ messages in thread
From: cel @ 2025-01-28 14:40 UTC (permalink / raw)
To: Jeff Layton, NeilBrown; +Cc: Chuck Lever, linux-nfs
From: Chuck Lever <chuck.lever@oracle.com>
On Tue, 28 Jan 2025 10:05:03 +1100, NeilBrown wrote:
> A recent patch moved the assignment of seq->maxslots from before the
> test for a resent request (which ends with a goto) to after, resulting
> in it not being run in that case. This results in the server returning
> bogus "high slot id" and "target high slot id" values.
>
> The assignments to ->maxslots and ->target_maxslots need to be *after*
> the out: label so that the correct values are returned in replies to
> requests that are served from cache.
>
> [...]
Applied to nfsd-testing, thanks!
Because I sent the NFSD 6.14 PR yesterday, this fix will be queued
up for 6.14-rc once it has completed a round of testing.
[1/1] nfsd: fix uninitialised slot info when a request is retried
commit: 78843acb930e16c6f8aa4abd3b82b997c03018c7
--
Chuck Lever
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-28 14:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 23:05 [PATCH nfsd-next] nfsd: fix uninitialised slot info when a request is retried NeilBrown
2025-01-28 11:16 ` Jeff Layton
2025-01-28 14:40 ` cel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox