From nobody Fri Jan 10 14:50:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4Mn6Jbkz5kSHN; Fri, 10 Jan 2025 14:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4Mn4BsNz4sVw; Fri, 10 Jan 2025 14:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736520645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v/Z8Fx5QjRITUhxaX5Rlg4IkCeb8fBpolcm3+DQFQGQ=; b=p6bWQxDLorMBbtuVPfbAF2AaONikC1RxPnHt61Q7UpT8PfxkA4IlJ2WH/n0dxp4GHeUrae nux5vil8fOfbjUUhoQswXO7i4u3ezo+vHv9yYOSoucIloEns1+1GTpFSHQQXr/HgZ3LwBy EezyPgNjpkjYHnqakOGYJ1tmPiFNkv5863TnOwGqRI3smHslv9BK40daj279FW2V/phwCb DbwJzwBtQOUDpxZtxS8x0zn5gyTtBNNmu4xDOGQFPWS53AV1IMioemWctmKla5KCr60wFX a+hys+4oAFIsg98xf+rIRczw4+dpr3htIADfA4idl/Hfd85Evx1KGbSXGr4TEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736520645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v/Z8Fx5QjRITUhxaX5Rlg4IkCeb8fBpolcm3+DQFQGQ=; b=Hl8P7P6mx+1mBZGmokAs+d2i9kPDsQYMD2Zd346PLTLfhZazCVdPEoCLkLjViCOE49/fOw JQvF3lAKFxOpuDTOdjX08inMMpin5TsEwSWTpGdUkOAj5/9br5aGtanLpnhPgCflCXIFC5 xqBBYiqlyhDJQmG9C0pWgGQykC42OTlsFJJkhjymVaQJiM8GZmFa4hHfZMnhiI1CgYKPkd gaUWrQj+Hp99jq0DkGxps9NQ11MzhUwRRdFzH1/fKNCMZJVijf8KsqizlGUKVl1igT9nEK cFIQEtX+lr2Oq+AnBQmMwW+82ITeuRDwD48Vch6pbTQcNckCH1alBcbfLdHslQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736520645; a=rsa-sha256; cv=none; b=cuC3MeNl3H+ne2NX4RFmmqiXQanvv37GOjHGB7Q1eBZsQL13JDNPi3AmGcIRF7zk+Z2f0k djEfzbBG/WDAYuGWONyxwrSxcChfCEBuGUrw8baqgCGQl5UwOASg48Wslw/Xp7Vs601dwf MCFCYSQbrC6NYlYwP3FwrFqj5yqc8Cgi8Y8b7FEBKYIqmrYVlTuCM5jz4otdDTQscDJBTR Y/GMLcp3MS0PITtEJMCbWHP4J23XvD1E+NlG1gXFRPr+sMB0rHyjWt7DenBOEn+sTgpbdI 16NnR636DGfsRmDSb8Gtpae9y3R0heyAa32B+BVXJFxgycZCyDQJKCaIEvIWbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4Mn3dHNz1PZ; Fri, 10 Jan 2025 14:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AEojZt029473; Fri, 10 Jan 2025 14:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AEojGv029470; Fri, 10 Jan 2025 14:50:45 GMT (envelope-from git) Date: Fri, 10 Jan 2025 14:50:45 GMT Message-Id: <202501101450.50AEojGv029470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 84de8c51d1a0 - main - nfsd: Add vfs.nfsd.testing_disable_grace sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84de8c51d1a0fff1c65cd1ec44dd3c3a0e7904eb Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=84de8c51d1a0fff1c65cd1ec44dd3c3a0e7904eb commit 84de8c51d1a0fff1c65cd1ec44dd3c3a0e7904eb Author: Rick Macklem AuthorDate: 2025-01-10 14:49:45 +0000 Commit: Rick Macklem CommitDate: 2025-01-10 14:49:45 +0000 nfsd: Add vfs.nfsd.testing_disable_grace sysctl The grace time of 2 minutes plus when the nfsd is started is needed for normal operation. It allows client(s) to recovery open/lock state. However, for testing situations where there are no client(s) to recover state, it introduces an unacceptable delay. The new per-vnet jail sysctl can be set non-zero to disable the grace period. It should only be used for testing and can be applied on a per-jail basis. It must be set before the nfsd is started up. Requested by: asomers Tested by: asomers --- sys/fs/nfsserver/nfs_nfsdstate.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 6cd8c1c861ec..d1639f48451c 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -115,6 +115,11 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, flexlinuxhack, CTLFLAG_RW, &nfsrv_flexlinuxhack, 0, "For Linux clients, hack around Flex File Layout bug"); +NFSD_VNET_DEFINE_STATIC(bool, nfsd_disable_grace) = false; +SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, testing_disable_grace, + CTLFLAG_NFSD_VNET | CTLFLAG_RW, &NFSD_VNET_NAME(nfsd_disable_grace), + 0, "Disable grace for testing"); + /* * Hash lists for nfs V4. */ @@ -4381,11 +4386,13 @@ nfsrv_checkgrace(struct nfsrv_descript *nd, struct nfsclient *clp, * ReclaimComplete. If so, grace can end now. */ notreclaimed = 0; - LIST_FOREACH(sp, &NFSD_VNET(nfsrv_stablefirst).nsf_head, - nst_list) { - if ((sp->nst_flag & NFSNST_RECLAIMED) == 0) { - notreclaimed = 1; - break; + if (!NFSD_VNET(nfsd_disable_grace)) { + LIST_FOREACH(sp, &NFSD_VNET(nfsrv_stablefirst).nsf_head, + nst_list) { + if ((sp->nst_flag & NFSNST_RECLAIMED) == 0) { + notreclaimed = 1; + break; + } } } if (notreclaimed == 0)