From nobody Sat Jul 23 20:41:33 2022 X-Original-To: dev-commits-src-all@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 4Lqyrt0R9Jz4XgS1; Sat, 23 Jul 2022 20:41:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lqyrt0004z3X6q; Sat, 23 Jul 2022 20:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658608894; 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=7NEf9XGbXWIo3C84WQBKliCuicg9V9Cr/ixFxG1AxtI=; b=mQroyMpvv+gUOjxTOWbHlqyL4Hu7oJ4fwZkSsSxChHyzXhewppvtEnpcbA60Ib0ucEVMwV E4tUoFVaJTftRZ26FJAAXkzdtO35SwVNanzOevEKdHnpyveVv/hxMeplAVeZpBLgGqXF1p 21dWSB/ym9H0PmpyXKIYEuZEe6rWUoCw6nUIUROm6VCdv8gEyJ5qXAl+qGqQRff9j81qoy WIJwxZlHtBcnginanPJ/IaywtCoLWPL0uqIxMAh8ukcEaitb7sfv7I3Dsqsejmeqjz+U7h fVwDy2QwM8q9eIT71l5YHGSK0twbCoIXh3sC5LOgotembBN0Selz1aqXFvGZiQ== 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 4Lqyrs68zCzsnY; Sat, 23 Jul 2022 20:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26NKfXfk072625; Sat, 23 Jul 2022 20:41:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26NKfXw2072624; Sat, 23 Jul 2022 20:41:33 GMT (envelope-from git) Date: Sat, 23 Jul 2022 20:41:33 GMT Message-Id: <202207232041.26NKfXw2072624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f115e0e9e319 - stable/13 - nfscl: Fix setting of nfsess_defunct for nfscl_hasexpired() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f115e0e9e3198da0f21a0cb32bee966a27181c8d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658608894; 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=7NEf9XGbXWIo3C84WQBKliCuicg9V9Cr/ixFxG1AxtI=; b=RwpG4slcl7+XbFWkNslaE6dIYKTvAF0/0hv08hwDCGs536QOlu8+qOB6SPT9vqmKzbduLf CGTkZ3EyaOsWxQmALLLAqJR/foCzc4b/NymxLEeAy04aqMGGxQD/g8kLXFcZocDkbTy/Ef wXI1d3vvKnMb+tdtUwtKcBJ0kQfC7arKQyX+EAJi6Ul+VmMqcMcTd7eFixbKxIj+fUx9/L jw1dz93iRHzYDD4lZJhv/Ae2BYHaYN8hscyT8iPChcCbJ3NUAnJeZadfOdrPeQRnGkEpZK L6j3qDJin4TLAnw+G34bF+T9sIKlThnTjPRmTRPaBy+FxzFNWdKDTDkhjma02g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658608894; a=rsa-sha256; cv=none; b=UUca8gEepJdKrOXL5RSFJUylPp2gcoGtnKoZwdWh6Y0MaSPrc3fK2NCHvTR985ts16EtD+ QhOBdjwkwQ/kN3Idp2ZKAK9FoyFnvo40uZSaYYqmmCZUP+9Z+lzxSO7btTrWCMO3f7SiaB 5ipHv3GMqJb09aubHPGUt6r2edazS0l9mamkJp3P7ydriZP+KcM3NpyIZymszax9ylLOZ7 nB2+ERJfTNkF38T6loyXXSOcskSZGyxHLaBQOVZC3t4ujbIWrYWQ2dAcDIWRr1ae4BazrX eJ4OgSDu2x7Iz5SfC43cvIoL5ivDjQGKKX5ecnGKsb/uu0ER0AuBW/VtJUKK8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f115e0e9e3198da0f21a0cb32bee966a27181c8d commit f115e0e9e3198da0f21a0cb32bee966a27181c8d Author: Rick Macklem AuthorDate: 2022-07-08 14:37:36 +0000 Commit: Rick Macklem CommitDate: 2022-07-23 20:38:21 +0000 nfscl: Fix setting of nfsess_defunct for nfscl_hasexpired() Commit a7bb120f8b87 added a printf for the case where recovery has not marked the session defunct by setting nfsess_defunct to 1. It turns out that nfscl_hasexpired() calls nfsrpc_setclient() directly, without setting nfsess_defunct. This patch replaces the printf with code that sets nfsess_defunct to 1 to handle this case. If SIGTERM is issued to a process when it is doing I/O on an "intr" mount, the NFSv4 server may reply NFSERR_BADSTATEID, due to the Open being prematurely closed. This can result in a call to nfscl_hasexpired() to do a recovery. This would explain at least one hang described in the PR. PR: 260011 MFC after: 2 weeks (cherry picked from commit be7b87de16ffbabb81989e13a4b19a178e3ab8ee) --- sys/fs/nfsclient/nfs_clrpcops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index eac6c777324a..fbca55027807 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1061,10 +1061,12 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, */ tsep = NULL; if (TAILQ_FIRST(&nmp->nm_sess) != NULL) { + /* + * Mark the old session defunct. Needed + * when called from nfscl_hasexpired(). + */ tsep = NFSMNT_MDSSESSION(nmp); - if (tsep->nfsess_defunct == 0) - printf("nfsrpc_setclient: " - "nfsess_defunct not set\n"); + tsep->nfsess_defunct = 1; } TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, nfsclds_list);