Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: "NeilBrown" <neilb@suse.de>
To: Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>,
	Olga Kornievskaia <kolga@netapp.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: Petr Vorel <pvorel@suse.cz>, linux-nfs@vger.kernel.org
Subject: [PATCH] nfsd: don't fail OP_SETCLIENTID when there are lots of clients.
Date: Mon, 22 Apr 2024 12:09:19 +1000	[thread overview]
Message-ID: <171375175915.7600.6526208866216039031@noble.neil.brown.name> (raw)



The calculation of how many clients the nfs server can manage is only an
heuristic.  Triggering the laundromat to clean up old clients when we
have more than the heuristic limit is valid, but refusing to create new
clients is not.  Client creation should only fail if there really isn't
enough memory available.

This is not known to have caused a problem is production use, but
testing of lots of clients reports an error and it is not clear that
this error is justified.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/nfsd/nfs4state.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index daf83823ba48..8a40bb6a4a67 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2223,10 +2223,9 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name,
 	struct nfs4_client *clp;
 	int i;
 
-	if (atomic_read(&nn->nfs4_client_count) >= nn->nfs4_max_clients) {
+	if (atomic_read(&nn->nfs4_client_count) >= nn->nfs4_max_clients)
 		mod_delayed_work(laundry_wq, &nn->laundromat_work, 0);
-		return NULL;
-	}
+
 	clp = kmem_cache_zalloc(client_slab, GFP_KERNEL);
 	if (clp == NULL)
 		return NULL;
-- 
2.44.0


             reply	other threads:[~2024-04-22  2:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  2:09 NeilBrown [this message]
2024-04-22  5:00 ` [PATCH] nfsd: don't fail OP_SETCLIENTID when there are lots of clients Petr Vorel
2024-04-22 13:34 ` Chuck Lever
2024-04-22 23:33   ` NeilBrown
2024-04-23 13:15     ` Chuck Lever III
2024-04-23 18:02       ` Dai Ngo
2024-04-25  0:08       ` NeilBrown
2024-04-25 13:26         ` Chuck Lever
2024-04-23 15:12   ` Petr Vorel
2024-04-23 15:26     ` Chuck Lever

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=171375175915.7600.6526208866216039031@noble.neil.brown.name \
    --to=neilb@suse.de \
    --cc=Dai.Ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=kolga@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pvorel@suse.cz \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).