public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFS: Fix state renewals missing after boot
@ 2025-10-08 23:09 Joshua Watt
  2025-10-09 11:50 ` Jeff Layton
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Joshua Watt @ 2025-10-08 23:09 UTC (permalink / raw)
  To: linux-nfs, linux-kernel; +Cc: Joshua Watt, Trond Myklebust, Anna Schumaker

From: Joshua Watt <jpewhacker@gmail.com>

Since the last renewal time was initialized to 0 and jiffies start
counting at -5 minutes, any clients connected in the first 5 minutes
after a reboot would have their renewal timer set to a very long
interval. If the connection was idle, this would result in the client
state timing out on the server and the next call to the server would
return NFS4ERR_BADSESSION.

Fix this by initializing the last renewal time to the current jiffies
instead of 0.

Signed-off-by: Joshua Watt <jpewhacker@gmail.com>
---
 fs/nfs/client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 4e3dcc157a83..96cdfeb26a90 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -181,6 +181,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
 	clp->cl_nconnect = cl_init->nconnect;
 	clp->cl_max_connect = cl_init->max_connect ? cl_init->max_connect : 1;
 	clp->cl_net = get_net_track(cl_init->net, &clp->cl_ns_tracker, GFP_KERNEL);
+	clp->cl_last_renewal = jiffies;
 
 #if IS_ENABLED(CONFIG_NFS_LOCALIO)
 	seqlock_init(&clp->cl_boot_lock);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-10 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 23:09 [PATCH] NFS: Fix state renewals missing after boot Joshua Watt
2025-10-09 11:50 ` Jeff Layton
2025-10-09 21:16 ` Anna Schumaker
2025-10-09 21:48 ` [PATCH v2] NFS4: " Joshua Watt
2025-10-10 16:56 ` [PATCH] NFS: " kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox