From nobody Fri Jul 08 14:38:35 2022 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 CEB2D17D2E50; Fri, 8 Jul 2022 14:38:35 +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 4LfbVz5WkYz3nQn; Fri, 8 Jul 2022 14:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657291115; 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=q1o0OiaclEsi79TqmqNEK5WSdGM70rLN/r8Pvp7XPhw=; b=ThLVW3cLbhaZKzZF4OlKomivIV3y05kWYtqVna++vnPx2R9AnXiHwTieWyjJL59mCN0QG6 q5IqN1uu14m+uvPMQVBKRttZh/rSPZo7JnChGXBMRxAJtvj7/01R7bsoReF8m+HMihBdKR xw2d4lQYxq1zVUbRdh+dMyHZ5U0qUlrhaAROsxvjLYVHHnRbXOiT45d/NCrQWa5nr2OztE Xg2qTba0cRb/x6HncEVg2NEG9vIYPgfDrMm72s6lXbdxmqsFpwTbQOh5IGFH4TkPgavvR0 wTJUhO3i/XX2Meb2i8fZtO4Wh8H6Fb7SYc+Gxtom3XwWyH9NZKWhoEkFkMjqpQ== 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 4LfbVz4bHWz1PXs; Fri, 8 Jul 2022 14:38:35 +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 268EcZki007065; Fri, 8 Jul 2022 14:38:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 268EcZ3L007064; Fri, 8 Jul 2022 14:38:35 GMT (envelope-from git) Date: Fri, 8 Jul 2022 14:38:35 GMT Message-Id: <202207081438.268EcZ3L007064@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: be7b87de16ff - main - nfscl: Fix setting of nfsess_defunct for nfscl_hasexpired() 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: be7b87de16ffbabb81989e13a4b19a178e3ab8ee Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657291115; 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=q1o0OiaclEsi79TqmqNEK5WSdGM70rLN/r8Pvp7XPhw=; b=dNs4sR9u+hqzff3T5byX7MSFNSFLkAiC8Xqc3BDkziCf0NAZPdgTkfiAdU40W0/pGNpe+i e9gpw27IQQLh50z/px5sRCIO289N5ONWQGhppld8IJyo1vE5UmHzf7fw1gKdVz7eE2Mfua SJF31AfcJ7R77lHDB7kRkx8R49kbTT2kcuuoFPHX3t9LLjJUi++WC9xgp0pmjFaVWbEeQq JQ6n4q9EWXSbdBD2f8LMOfL496MnVPtEdon/R0YOPYRXtfoe9335ru58upam2wMDFDA58C MMfkCg5Cn7jsbcZn7WCqfexjrbiHyJn9NKCCQocGmKOthyc6qYjMW17np/S8lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657291115; a=rsa-sha256; cv=none; b=o6Uwp8uFErmJfCUzRymrVJ5qvwtM43th/kuYl+ByTAJ47QevBdURJTOYc56zDXHsWXQGyY Phzkyb59wwgHLTjPD1KI7r7vSvchXXyaty8eoOTX/ZNTFkeZcipT49xjoFm92ZKCCISF93 i+8bITcThFaqLWfEyNPhDqTxcKfpcQN8O8seF3ArZ+9yfwv/kZwCg+KXMP87WJ6z/TLNj4 twk2mVuzlaGpSugDNcgrsH30Hr4t47Xr/gghUfPdNvlbB6k2TNpRr93fjRLm3eTJQSMns5 PKoZWCCUAIklq6m4K/9DkIEoVo9sh3w81ypnKug3Bz+CQqQjAehoWsAAXRv12g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=be7b87de16ffbabb81989e13a4b19a178e3ab8ee commit be7b87de16ffbabb81989e13a4b19a178e3ab8ee Author: Rick Macklem AuthorDate: 2022-07-08 14:37:36 +0000 Commit: Rick Macklem CommitDate: 2022-07-08 14:37:36 +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 --- 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 d48f1887a5a9..9204767b7abf 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1057,10 +1057,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);