From patchwork Thu Jan 25 16:28:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531243 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2B2477F02 for ; Thu, 25 Jan 2024 16:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200127; cv=none; b=qzNHzdOJBgx+Y61KIU4NUU2K0kGQPLxiR9bEPh8vwqxXMDup0f8QZQo7TrzSR5L2yJMo99Bm/Ox2kGW/GWMWQZdNbzh3tVoIkmgp6aArBM0qkQVn6TupLvY4tXG9diJNuz89ujyLF/4TJSiBgTrF4ZJU8uqEqX4y+k/0c4A4RXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200127; c=relaxed/simple; bh=hdVGBrnBnC+42GuL+lMf5yaVyqNY2G8EPs25AdfRFjc=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AtRm7i5NuV1gVvdTsSLTFdXHzA03r3lYQnx7Us0dOqyotZcW2vdRrSFDIo81E1FURrA8a0Mqm9VNmVQnTvF6m1ekT24CRG5B/GLPjQkLlKMP3jbxoLZgSppKLTdwrkGZGKY8nE+KWEoJc6mDUQvEfzKan8fbasT6cG+TVwbBTR8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ev8uzAiG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ev8uzAiG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EBF8C433F1 for ; Thu, 25 Jan 2024 16:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200127; bh=hdVGBrnBnC+42GuL+lMf5yaVyqNY2G8EPs25AdfRFjc=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Ev8uzAiGOW8uBZbE8oAc+UF+bGGphf4svIlUFDzedwoNKKbBXV5ncKVQY81g591nN aWcBwO9jnyhInfiGlCDHlzD2ZGtIc4dB5NYvBwU0R8eXr3lkP38OAd85WwluHwtVO7 /he18oxvOVBy+fWuPhV0ONAw/yJXRjufluYBU34iA+JmCQaMXAH1N+pXZBO+PeAUaT uQB2u2zLHa4wewmy4CLE11KjAtH3Vm6oWajC5RnIMTITXESFohNQRRn3/EX0VE8Zgg 7jVhMRY8owIVG2vyACUf1OQQ24A/wdO3BAvoATUIt0/4ChfhTFF2Wv9jO9fvxCXdW4 NWfbTid0MZO9g== Subject: [PATCH RFC 01/13] NFSD: Reset cb_seq_status after NFS4ERR_DELAY From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:28:46 -0500 Message-ID: <170620012605.2833.4823193318339130630.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever I noticed that once an NFSv4.1 callback operation gets a NFS4ERR_DELAY status on CB_SEQUENCE and then the connection is lost, the callback client loops, resending it indefinitely. The switch arm in nfsd4_cb_sequence_done() that handles NFS4ERR_DELAY uses rpc_restart_call() to rearm the RPC state machine for the retransmit, but that path does not call the rpc_prepare_call callback again. Thus cb_seq_status is set to -10008 by the first NFS4ERR_DELAY result, but is never set back to 1 for the retransmits. nfsd4_cb_sequence_done() thinks it's getting nothing but a long series of CB_SEQUENCE NFS4ERR_DELAY replies. Fixes: 7ba6cad6c88f ("nfsd: New helper nfsd4_cb_sequence_done() for processing more cb errors") Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton --- fs/nfsd/nfs4callback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 926c29879c6a..43b0a34a5d5b 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1178,6 +1178,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback ret = false; break; case -NFS4ERR_DELAY: + cb->cb_seq_status = 1; if (!rpc_restart_call(task)) goto out; From patchwork Thu Jan 25 16:28:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531244 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30D9673177 for ; Thu, 25 Jan 2024 16:28:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200134; cv=none; b=mnO9I7gnL1AYMAYZt4+5yYYbU62cRJureddVefo44CzhXE4bspFAlwSjY5HJRwX4joI38EMqguw7MTPuS83iHAndTEcOZBGC9DKYOCFBbwE0U4g26XcrIwHlH2F5aqI2PrxrFe5csJZ/luay1n/VlRNB3MoxZmZEre8vKmIqqLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200134; c=relaxed/simple; bh=ZirEQrrH2B9FdI5tnbQePr1bsGZg3ZHsZpBpGBgGRbA=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XstthNJ89aS6vXfn7pdWMemgtAhznasvVWofSwxJY2R4Uo+7y1pyhYcqpxIATJRS1Y6rEw1tT+88i2EBqIR6sERrgI9Mg5jAOTLINrayJTHGiHLrSDJ3wjQf8Y+EeeW2K20+SDiBPMX9Dv3jCDwShFXu3PUbrvUR318H29hUuDk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JAPt+91f; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JAPt+91f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86370C433C7 for ; Thu, 25 Jan 2024 16:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200133; bh=ZirEQrrH2B9FdI5tnbQePr1bsGZg3ZHsZpBpGBgGRbA=; h=Subject:From:To:Date:In-Reply-To:References:From; b=JAPt+91fi4pBOPlg9sM30YIdzdHn1D6m1HuOssoxG6sYFPZyCe7pw8UKq6nUSWj1/ mqqyYpky6G2mtDMYnYA5C/qZA/ZXXBaUYS+BbAWNcL66K2DaTI7rrIwZvjX0/584uy eW7DcYGVG34zXLLfAilMGngacNk9dSiEmTXnx7xS8fgOj/HQlFFJw7LEyYujAeApS6 JLZWyTENagGW7dw/UhmikKDI+Y3HXFPirxxaI6diZsqVIZblGw8fpz4MZmg+BssaId tBLyl01VK/n5U3BuIeF4VI4Tww7rFve/1z52G9wrT7x6bFq90TUUbBLBUjksZRgr/P Le0qur6WE26dA== Subject: [PATCH RFC 02/13] NFSD: Reschedule CB operations when backchannel rpc_clnt is shut down From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:28:52 -0500 Message-ID: <170620013252.2833.10156142379669175540.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever As part of managing a client disconnect, NFSD closes down and replaces the backchannel rpc_clnt. If a callback operation is pending when the backchannel rpc_clnt is shut down, currently nfsd4_run_cb_work() just discards that callback. But there are multiple cases to deal with here: o The client's lease is getting destroyed. Throw the CB away. o The client disconnected. It might be forcing a retransmit of CB operations, or it could have disconnected for other reasons. Reschedule the CB so it is retransmitted when the client reconnects. Since callback operations can now be rescheduled, ensure that cb_ops->prepare can be called only once by moving the cb_ops->prepare paragraph down to just before the rpc_call_async() call. Fixes: 2bbfed98a4d8 ("nfsd: Fix races between nfsd4_cb_release() and nfsd4_shutdown_callback()") Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 43b0a34a5d5b..b2844abcb51f 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1375,20 +1375,22 @@ nfsd4_run_cb_work(struct work_struct *work) struct rpc_clnt *clnt; int flags; - if (cb->cb_need_restart) { - cb->cb_need_restart = false; - } else { - if (cb->cb_ops && cb->cb_ops->prepare) - cb->cb_ops->prepare(cb); - } - if (clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK) nfsd4_process_cb_update(cb); clnt = clp->cl_cb_client; if (!clnt) { - /* Callback channel broken, or client killed; give up: */ - nfsd41_destroy_cb(cb); + if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) + nfsd41_destroy_cb(cb); + else { + /* + * XXX: Ideally, we would wait for the client to + * reconnect, but I haven't figured out how + * to do that yet. + */ + msleep(30); + nfsd4_queue_cb(cb); + } return; } @@ -1401,6 +1403,12 @@ nfsd4_run_cb_work(struct work_struct *work) return; } + if (cb->cb_need_restart) { + cb->cb_need_restart = false; + } else { + if (cb->cb_ops && cb->cb_ops->prepare) + cb->cb_ops->prepare(cb); + } cb->cb_msg.rpc_cred = clp->cl_cb_cred; flags = clp->cl_minorversion ? RPC_TASK_NOCONNECT : RPC_TASK_SOFTCONN; rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | flags, From patchwork Thu Jan 25 16:28:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531245 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7EDC73177 for ; Thu, 25 Jan 2024 16:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200140; cv=none; b=ER7zVd66zxp2Y7nqBRQp+6Bulx0q/sZi3vIhTE4LNxCtY2rErH9nsVck3V0quKAUVl1iMSnSSDVuuvAwx0Aw1pRc1iU9lKVDLCCewGzg8jz11+oxGpXxiNkPkNuDD0UW7AieKM8Duh4sh8JkcloWlIGdaBPd//t0Mwb8ndzbE7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200140; c=relaxed/simple; bh=vlt3M4RIx68QmXCQCc6F6OIkuYYv9j05uwrzFmKuN+M=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=alwJzdc+ZK3GYn45pNjTG+j/a6M55yA9NzMgBTWCFbHxAiuno6jP4QPGLzLhRnMv82c2m5k7/VtEfjuSpmg4uRpfPa2tY35VOBDMKf3KDLfXQG7p215v1Pp2S1SQFqvAbaWPUyMGkIiTvA+9pcB+He99x7xFyF89mkSYMpkNQ38= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GoMHj3ok; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GoMHj3ok" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18DD0C433C7 for ; Thu, 25 Jan 2024 16:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200140; bh=vlt3M4RIx68QmXCQCc6F6OIkuYYv9j05uwrzFmKuN+M=; h=Subject:From:To:Date:In-Reply-To:References:From; b=GoMHj3okixJ33RDYmAo2Psb+QNRr1R0X84PYEmFNqpEsNMt3FLJzRy+Zb3v44n0JT kojFsntXr7v65cPKleCGFevwAx0PKXI7k9wZhtcbx6gDCFfWLclnZWrGUpetsxBUYq AUVC1YzLVT76dQt15Jels7AgntVAvzblfxWoGBH7pNheEGjtnGAaJO9E01iEWsVHet Ot0jqJE4EyqaeVvWPhf2fP4Ul6y/SMqbTUe5NBr4p7cxHosAitftkL8NvXaSB+Sgu8 YKXhlkpe0b1St2iRWBLe4WwHlJ5VjJktO8gx3DIFm52kPg1SI4L0ZBMuVD39WJmruA 4ko39OzjjL2Bg== Subject: [PATCH RFC 03/13] NFSD: Retransmit callbacks after client reconnects From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:28:58 -0500 Message-ID: <170620013890.2833.522544267659511118.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever NFSv4.1 clients assume that if they disconnect, that will force the server to resend pending callback operations once a fresh connection has been established. Turns out NFSD has not been resending after reconnect. Fixes: 7ba6cad6c88f ("nfsd: New helper nfsd4_cb_sequence_done() for processing more cb errors") Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton --- fs/nfsd/nfs4callback.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index b2844abcb51f..1ff64efe1f5c 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1171,12 +1171,21 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback break; case -ESERVERFAULT: ++session->se_cb_seq_nr; - fallthrough; + nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); + ret = false; + break; case 1: + /* + * cb_seq_status remains 1 if an RPC Reply was never + * received. NFSD can't know if the client processed + * the CB_SEQUENCE operation. Ask the client to send a + * DESTROY_SESSION to recover. + */ + fallthrough; case -NFS4ERR_BADSESSION: nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); ret = false; - break; + goto need_restart; case -NFS4ERR_DELAY: cb->cb_seq_status = 1; if (!rpc_restart_call(task)) From patchwork Thu Jan 25 16:29:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531246 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AA2A73177 for ; Thu, 25 Jan 2024 16:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200147; cv=none; b=OHG7mQn9gpozGNFqbVWpU7Xr4iYRfExwJ78oUWN+6Gj2iiUZLHvdFac6h9AmSm4h7ahZZzFOLC5LRROQNXumZiLPsUmobvJL+flYbGEM12op7NMOMp8ctkE17Xi6DYGDdYlAoyaNtP60BHpZ8YG9+2LoKx+utn2v4OIPGS2ggNw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200147; c=relaxed/simple; bh=8GoL0ubXrSyZcwFONaLSEzFwk/AxuWvp02+Msco9Cnk=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kLPgkamIGQu1U25zgan+A0r4Hqnhdi0M+NW87lHCOMlRSMDjM3+jtFAPQ25tiKd/j6hUmxQaksZaoiLs0WRoCRPdl1DXdF+Lbvug1/eXa3LuXvgEgNGn0fRCF3oTBMERmHkTRJcVVeuHBMrZ2yLGZk77ZF9LO7SMRQUjuzCa5fw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Araa1xZu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Araa1xZu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BE6DC433C7 for ; Thu, 25 Jan 2024 16:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200146; bh=8GoL0ubXrSyZcwFONaLSEzFwk/AxuWvp02+Msco9Cnk=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Araa1xZuDhuUuknAXXIb7p0fy55ZQqFBmqxGn4k7Djh6MVcaAVA4ypeT2bgXW9G6c bXZT6q6KRtA+2xAIN5xzeXzCEOgSZlislxHu/dcBvH5QzSs9Do6GVZCq9IC5SpGznH 1VysYlZPTCFtPCcRa6D4lnL6OzxRmOTw6Dz5L4dfevdpf/zzFx8z9qU7cG2nn8W4Yy isUfbDYAiOcqarbLBC0Wp+ucCo/gDAynjngFE35wk8o5JOB07KnCC0ZW4ZBiQU7bbd TPQWaaz5y670/pq1UHtUUyDllB2B3ced2qcZouHRI1wKl0BJnd7D8EReiBNs+ITw/r fDUKuJODdKFaw== Subject: [PATCH RFC 04/13] NFSD: Add nfsd_seq4_status trace event From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:05 -0500 Message-ID: <170620014547.2833.2715928724069344285.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Add a trace point that records SEQ4_STATUS flags returned in an NFSv4.1 SEQUENCE response. SEQ4_STATUS flags report backchannel issues and changes to lease state to clients. Knowing what the server is reporting to clients is useful for debugging both configuration and operational issues in real time. For example, upcoming patches will enable server administrators to revoke parts of a client's lease; that revocation is indicated to the client when a subsequent SEQUENCE operation has one or more SEQ4_STATUS flags that are set. Sample trace records: nfsd-927 [006] 615.581821: nfsd_seq4_status: xid=0x095ded07 sessionid=65a032c3:b7845faf:00000001:00000000 status_flags=BACKCHANNEL_FAULT nfsd-927 [006] 615.588043: nfsd_seq4_status: xid=0x0a5ded07 sessionid=65a032c3:b7845faf:00000001:00000000 status_flags=BACKCHANNEL_FAULT nfsd-928 [003] 615.588448: nfsd_seq4_status: xid=0x0b5ded07 sessionid=65a032c3:b7845faf:00000001:00000000 status_flags=BACKCHANNEL_FAULT Signed-off-by: Chuck Lever --- fs/nfsd/nfs4state.c | 1 + fs/nfsd/trace.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d7d561b29fb0..3d6e3dcfdee1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4058,6 +4058,7 @@ nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } if (!list_empty(&clp->cl_revoked)) seq->status_flags |= SEQ4_STATUS_RECALLABLE_STATE_REVOKED; + trace_nfsd_seq4_status(rqstp, seq); out_no_session: if (conn) free_conn(conn); diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index d1e8cf079b0f..38d11b43779c 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -696,6 +696,41 @@ DEFINE_EVENT(nfsd_stid_class, nfsd_stid_##name, \ DEFINE_STID_EVENT(revoke); +TRACE_EVENT_CONDITION(nfsd_seq4_status, + TP_PROTO( + const struct svc_rqst *rqstp, + const struct nfsd4_sequence *sequence + ), + TP_ARGS(rqstp, sequence), + TP_CONDITION(sequence->status_flags), + TP_STRUCT__entry( + __field(unsigned int, netns_ino) + __field(u32, xid) + __field(u32, cl_boot) + __field(u32, cl_id) + __field(u32, seqno) + __field(u32, reserved) + __field(unsigned long, status_flags) + ), + TP_fast_assign( + const struct nfsd4_sessionid *sid = + (struct nfsd4_sessionid *)&sequence->sessionid; + + __entry->netns_ino = SVC_NET(rqstp)->ns.inum; + __entry->xid = be32_to_cpu(rqstp->rq_xid); + __entry->cl_boot = sid->clientid.cl_boot; + __entry->cl_id = sid->clientid.cl_id; + __entry->seqno = sid->sequence; + __entry->reserved = sid->reserved; + __entry->status_flags = sequence->status_flags; + ), + TP_printk("xid=0x%08x sessionid=%08x:%08x:%08x:%08x status_flags=%s", + __entry->xid, __entry->cl_boot, __entry->cl_id, + __entry->seqno, __entry->reserved, + show_nfs4_seq4_status(__entry->status_flags) + ) +); + DECLARE_EVENT_CLASS(nfsd_clientid_class, TP_PROTO(const clientid_t *clid), TP_ARGS(clid), From patchwork Thu Jan 25 16:29:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531247 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D19E73177 for ; Thu, 25 Jan 2024 16:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200153; cv=none; b=UcT4/h/zbU/E1WWaQ2lGKqbfvsUFY669NzlERElAAPGPRzHDrKjS0IQDUntwyE1EpiFeBqq+Hdyct+VQyzC4MOop4f4EGIk2+4blIyl0VXyNr3kG9pS3fFVYw0CiesYjhR3DWKjLQMgTg5AJmwERz+U2bPql3oQ1/VZEHAKfCJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200153; c=relaxed/simple; bh=yg1cathIUyrV9IS6y9PWgPaIGAsOOS1P24iPNTZKq58=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CRFnchcTiPwcZ44r54oLxUD1kS08wSE8j0E1dLRo/YKYgBLNuXFulh0zDkKggdLMe7g3M8dtFdtWpNNHDh803pnk+BcEo6HhToVIKfiRYXX+MuFvPBARoOOvI8gVKFJw0acqIIlPRCjCHtHXag8tGhpGHZ4zMDTxxLSLlV+jCbs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lr9m2JgI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Lr9m2JgI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCF91C433F1 for ; Thu, 25 Jan 2024 16:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200153; bh=yg1cathIUyrV9IS6y9PWgPaIGAsOOS1P24iPNTZKq58=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Lr9m2JgIJ904brilZ2ichIILSswrLRueCRoWDIPA7eXt0Ejo+pQc9Y026Uyheffl5 K3BmcWnohsq++yrpP0GA8qQamkmasazj1J5QWYbXkmbl1C8Yq8LbnsKCmvT2N1sQb4 NcacEhvt+MCJatoJgBwTQpl7AxvXx+BU2pKMP1hVTFmIaPylpJHvIG1mV9Bz8Q7WR5 LJlF6a0uJlpAD+mUp+qSCWYjVqyzanxF2yO7pZY8DBAdBPeezMzIzc3sBlVEquuJ1k IoH3liyYLmhiW3ETHO/EDu9an+5GeXwMKPioKG1ZzfBKBprApnIoeSDct/aKOJFbuH icTjoT0WQJQvw== Subject: [PATCH RFC 05/13] NFSD: Replace dprintks in nfsd4_cb_sequence_done() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:11 -0500 Message-ID: <170620015178.2833.16037962437262794375.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Improve observability of backchannel session operation. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 9 ++--- fs/nfsd/trace.h | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 5 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 1ff64efe1f5c..9f5aebeef83c 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1158,6 +1158,8 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback if (!cb->cb_holds_slot) goto need_restart; + /* This is the operation status code for CB_SEQUENCE */ + trace_nfsd_cb_seq_status(task, cb); switch (cb->cb_seq_status) { case 0: /* @@ -1203,13 +1205,10 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback break; default: nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); - dprintk("%s: unprocessed error %d\n", __func__, - cb->cb_seq_status); } - nfsd41_cb_release_slot(cb); - dprintk("%s: freed slot, new seqid=%d\n", __func__, - clp->cl_cb_session->se_cb_seq_nr); + + trace_nfsd_cb_free_slot(task, cb); if (RPC_SIGNALLED(task)) goto need_restart; diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 38d11b43779c..c134c755ae5d 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -9,8 +9,10 @@ #define _NFSD_TRACE_H #include +#include #include #include +#include #include "export.h" #include "nfsfh.h" @@ -1440,6 +1442,86 @@ TRACE_EVENT(nfsd_cb_setup_err, __entry->error) ); +TRACE_EVENT(nfsd_cb_seq_status, + TP_PROTO( + const struct rpc_task *task, + const struct nfsd4_callback *cb + ), + TP_ARGS(task, cb), + TP_STRUCT__entry( + __field(unsigned int, task_id) + __field(unsigned int, client_id) + __field(u32, cl_boot) + __field(u32, cl_id) + __field(u32, seqno) + __field(u32, reserved) + __field(int, tk_status) + __field(int, seq_status) + ), + TP_fast_assign( + const struct nfs4_client *clp = cb->cb_clp; + const struct nfsd4_session *session = clp->cl_cb_session; + const struct nfsd4_sessionid *sid = + (struct nfsd4_sessionid *)&session->se_sessionid; + + __entry->task_id = task->tk_pid; + __entry->client_id = task->tk_client ? + task->tk_client->cl_clid : -1; + __entry->cl_boot = sid->clientid.cl_boot; + __entry->cl_id = sid->clientid.cl_id; + __entry->seqno = sid->sequence; + __entry->reserved = sid->reserved; + __entry->tk_status = task->tk_status; + __entry->seq_status = cb->cb_seq_status; + ), + TP_printk(SUNRPC_TRACE_TASK_SPECIFIER + " sessionid=%08x:%08x:%08x:%08x tk_status=%d seq_status=%d\n", + __entry->task_id, __entry->client_id, + __entry->cl_boot, __entry->cl_id, + __entry->seqno, __entry->reserved, + __entry->tk_status, __entry->seq_status + ) +); + +TRACE_EVENT(nfsd_cb_free_slot, + TP_PROTO( + const struct rpc_task *task, + const struct nfsd4_callback *cb + ), + TP_ARGS(task, cb), + TP_STRUCT__entry( + __field(unsigned int, task_id) + __field(unsigned int, client_id) + __field(u32, cl_boot) + __field(u32, cl_id) + __field(u32, seqno) + __field(u32, reserved) + __field(u32, slot_seqno) + ), + TP_fast_assign( + const struct nfs4_client *clp = cb->cb_clp; + const struct nfsd4_session *session = clp->cl_cb_session; + const struct nfsd4_sessionid *sid = + (struct nfsd4_sessionid *)&session->se_sessionid; + + __entry->task_id = task->tk_pid; + __entry->client_id = task->tk_client ? + task->tk_client->cl_clid : -1; + __entry->cl_boot = sid->clientid.cl_boot; + __entry->cl_id = sid->clientid.cl_id; + __entry->seqno = sid->sequence; + __entry->reserved = sid->reserved; + __entry->slot_seqno = session->se_cb_seq_nr; + ), + TP_printk(SUNRPC_TRACE_TASK_SPECIFIER + " sessionid=%08x:%08x:%08x:%08x new slot seqno=%u\n", + __entry->task_id, __entry->client_id, + __entry->cl_boot, __entry->cl_id, + __entry->seqno, __entry->reserved, + __entry->slot_seqno + ) +); + TRACE_EVENT_CONDITION(nfsd_cb_recall, TP_PROTO( const struct nfs4_stid *stid From patchwork Thu Jan 25 16:29:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531248 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA41012A14C for ; Thu, 25 Jan 2024 16:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200159; cv=none; b=unMzz0lsXErSIn2qLkWXISSqf9bXxdZKk1sCL303jUIV1YHKsQ74BJSPwu/NFiL7FlFDcI0B2KKzuIBsy6lglv2UElyjN3DT+ULlhWwLIJiopIrCQZj4ZXPWxHZi5IAQL+h2zEwyBgVzABw5KwlxVr60pvt1tjyYmEX5S94n/m4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200159; c=relaxed/simple; bh=oyWw8rysShVN6IpXiV9QH8TKsHat67OtD+iwKutFCOY=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pAAVnzXq4IeFxu0isBCemfkbuLEU1kVelrkBY6FhEHHzLnCenuyHIJRTUSvtC5ulWwI4K6ebzGP0bUL3SNliP/a0zZs59skqhLMS9F2bKGMk+0nzQye1T2EaxIPc72CMqtBeOMSRwLebvjq3r63p1zCPWGg0VcYEkfw4gFH/VzU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iprIkzQm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iprIkzQm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 364CBC43399 for ; Thu, 25 Jan 2024 16:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200159; bh=oyWw8rysShVN6IpXiV9QH8TKsHat67OtD+iwKutFCOY=; h=Subject:From:To:Date:In-Reply-To:References:From; b=iprIkzQmdrGzPKFMH+J1mfZmhFOMR0+JRrQg+OaFU6szpPUmy/zsjohnpP1ZlW/q6 SwXfmjGbEbh3e/tRmW9EL3vO7oJIsrZBq+aCPgDcq+z/RBTf5+I7BZTZM0LSL7/8IF W/PJMFIDAdcv9ytaAWHQMoIgVeMhRxKP9eeMMeX3N+3XfrfpIJmLDm1qGU0Vb3SGHX bso0F2Omyodk3cBLJR0AUZNSHDwKiDCWb8xahCl1hgmsTvEIcCuTXdE8X6300RZN1a cT6qVy/waeaOnJcVWdxnt9tdQPIfOgzyNXuKO76DRJDjK1bG0avBh8WLNTS58I2eob t5kDtm86vuDvw== Subject: [PATCH RFC 06/13] NFSD: Rename nfsd_cb_state trace point From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:18 -0500 Message-ID: <170620015818.2833.16183397044635913129.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Make it clear where backchannel state is updated. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 4 +++- fs/nfsd/trace.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 9f5aebeef83c..1c85426830b1 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -999,7 +999,7 @@ static void nfsd4_mark_cb_state(struct nfs4_client *clp, int newstate) { if (clp->cl_cb_state != newstate) { clp->cl_cb_state = newstate; - trace_nfsd_cb_state(clp); + trace_nfsd_cb_new_state(clp); } } @@ -1383,6 +1383,8 @@ nfsd4_run_cb_work(struct work_struct *work) struct rpc_clnt *clnt; int flags; + trace_nfsd_cb_start(clp); + if (clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK) nfsd4_process_cb_update(cb); diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index c134c755ae5d..6003af2bee33 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -1371,7 +1371,8 @@ DEFINE_EVENT(nfsd_cb_class, nfsd_cb_##name, \ TP_PROTO(const struct nfs4_client *clp), \ TP_ARGS(clp)) -DEFINE_NFSD_CB_EVENT(state); +DEFINE_NFSD_CB_EVENT(start); +DEFINE_NFSD_CB_EVENT(new_state); DEFINE_NFSD_CB_EVENT(probe); DEFINE_NFSD_CB_EVENT(lost); DEFINE_NFSD_CB_EVENT(shutdown); From patchwork Thu Jan 25 16:29:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531249 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C3B712AAC8 for ; Thu, 25 Jan 2024 16:29:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200166; cv=none; b=S5nH3lf6pJvfUKDqVSOEfIPqC8Ff/q1W0NNP8W7hF9BK8yGCMpt3PBrd+rO7jluj+mV1aTSGIjSIV/SLEKKDoPATYUSiGh8CLMitox8Cw829hBI1SE0hEIOjbyS5Cz5rKT/ZdqEgJ3l7nKh8wyCVRd5h4TZAr4WySgrAxl2QDpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200166; c=relaxed/simple; bh=JCksfE9E9NZpEYvbjJDNRnwygfp+WHNDxgF+YzMgTPA=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WVEtMgfoEZUQcFoOcSM2sx1fZAwyoUDTigK6khcUF7kfMUGlPFa7i/npKi8DeQylPkZce7drWBE7iWrR3SZtam/2W4pceApN4tRBnkGb304wgB+8IUHcHkHIrZeZrYSn9Xu+1nI3FpMUP4c1sUr1lFlVFKb42Wsu0U15Fdh5420= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D8UAz5A7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D8UAz5A7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87199C43390 for ; Thu, 25 Jan 2024 16:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200165; bh=JCksfE9E9NZpEYvbjJDNRnwygfp+WHNDxgF+YzMgTPA=; h=Subject:From:To:Date:In-Reply-To:References:From; b=D8UAz5A7Uq2++5yXZuyTUcHNz2slMy2gyVFAETkJp1ryKrT/IztRH6QjDG+kNYI5s LtM6oGsLHfPVluriAOp7TmgLMJYD6hVKBSnSZOhcoPhj0hU8IaqFsGHcnd5aZvr8AS cSF6G4P5d0/+waYW2t/qFOUXJo4WeJNR9AT0zyBUPbeMrdCw7GqxouuQJjXvxLbHzV 22+OV7EEeS2Aj2WLuL7NQAlan0Vxa7zow2F2SVveVQSgSNUs/hkcPnP90khgRWyJVw Batnrb+8fvv2iA/6R2O9KF0HqL7dtcnyOi3Pihh9rbz+9Xg/G5tuoaDuxxuUk4bY9u uh6xriCPatkxA== Subject: [PATCH RFC 07/13] NFSD: Add callback operation lifetime trace points From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:24 -0500 Message-ID: <170620016455.2833.5426224225062159088.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Help observe the flow of callback operations. bc_shutdown() records exactly when the backchannel RPC client is destroyed and cl_cb_client is replaced with NULL. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 7 +++++++ fs/nfsd/trace.h | 42 ++++++++++++++++++++++++++++++++++++++++++ include/trace/misc/nfs.h | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 1c85426830b1..4d5a6370b92c 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -887,6 +887,7 @@ static struct workqueue_struct *callback_wq; static bool nfsd4_queue_cb(struct nfsd4_callback *cb) { + trace_nfsd_cb_queue(cb->cb_clp, cb); return queue_work(callback_wq, &cb->cb_work); } @@ -1106,6 +1107,7 @@ static void nfsd41_destroy_cb(struct nfsd4_callback *cb) { struct nfs4_client *clp = cb->cb_clp; + trace_nfsd_cb_destroy(clp, cb); nfsd41_cb_release_slot(cb); if (cb->cb_ops && cb->cb_ops->release) cb->cb_ops->release(cb); @@ -1220,6 +1222,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback goto out; need_restart: if (!test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) { + trace_nfsd_cb_restart(clp, cb); task->tk_status = 0; cb->cb_need_restart = true; } @@ -1333,11 +1336,14 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) struct nfsd4_conn *c; int err; + trace_nfsd_cb_bc_update(clp, cb); + /* * This is either an update, or the client dying; in either case, * kill the old client: */ if (clp->cl_cb_client) { + trace_nfsd_cb_bc_shutdown(clp, cb); rpc_shutdown_client(clp->cl_cb_client); clp->cl_cb_client = NULL; put_cred(clp->cl_cb_cred); @@ -1349,6 +1355,7 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) } if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) return; + spin_lock(&clp->cl_lock); /* * Only serialized callback code is allowed to clear these diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 6003af2bee33..9f9e58debc26 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -1443,6 +1443,48 @@ TRACE_EVENT(nfsd_cb_setup_err, __entry->error) ); +DECLARE_EVENT_CLASS(nfsd_cb_lifetime_class, + TP_PROTO( + const struct nfs4_client *clp, + const struct nfsd4_callback *cb + ), + TP_ARGS(clp, cb), + TP_STRUCT__entry( + __field(u32, cl_boot) + __field(u32, cl_id) + __field(const void *, cb) + __field(bool, need_restart) + __sockaddr(addr, clp->cl_cb_conn.cb_addrlen) + ), + TP_fast_assign( + __entry->cl_boot = clp->cl_clientid.cl_boot; + __entry->cl_id = clp->cl_clientid.cl_id; + __entry->cb = cb; + __entry->need_restart = cb->cb_need_restart; + __assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr, + clp->cl_cb_conn.cb_addrlen) + ), + TP_printk("addr=%pISpc client %08x:%08x cb=%p%s", + __get_sockaddr(addr), __entry->cl_boot, __entry->cl_id, + __entry->cb, __entry->need_restart ? + " (need restart)" : " (first try)" + ) +); + +#define DEFINE_NFSD_CB_LIFETIME_EVENT(name) \ +DEFINE_EVENT(nfsd_cb_lifetime_class, nfsd_cb_##name, \ + TP_PROTO( \ + const struct nfs4_client *clp, \ + const struct nfsd4_callback *cb \ + ), \ + TP_ARGS(clp, cb)) + +DEFINE_NFSD_CB_LIFETIME_EVENT(queue); +DEFINE_NFSD_CB_LIFETIME_EVENT(destroy); +DEFINE_NFSD_CB_LIFETIME_EVENT(restart); +DEFINE_NFSD_CB_LIFETIME_EVENT(bc_update); +DEFINE_NFSD_CB_LIFETIME_EVENT(bc_shutdown); + TRACE_EVENT(nfsd_cb_seq_status, TP_PROTO( const struct rpc_task *task, diff --git a/include/trace/misc/nfs.h b/include/trace/misc/nfs.h index 0d9d48dca38a..64ab5dac59ce 100644 --- a/include/trace/misc/nfs.h +++ b/include/trace/misc/nfs.h @@ -385,3 +385,37 @@ TRACE_DEFINE_ENUM(IOMODE_ANY); { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, "RESTART_RECLAIM_NEEDED" }, \ { SEQ4_STATUS_CB_PATH_DOWN_SESSION, "CB_PATH_DOWN_SESSION" }, \ { SEQ4_STATUS_BACKCHANNEL_FAULT, "BACKCHANNEL_FAULT" }) + +TRACE_DEFINE_ENUM(OP_CB_GETATTR); +TRACE_DEFINE_ENUM(OP_CB_RECALL); +TRACE_DEFINE_ENUM(OP_CB_LAYOUTRECALL); +TRACE_DEFINE_ENUM(OP_CB_NOTIFY); +TRACE_DEFINE_ENUM(OP_CB_PUSH_DELEG); +TRACE_DEFINE_ENUM(OP_CB_RECALL_ANY); +TRACE_DEFINE_ENUM(OP_CB_RECALLABLE_OBJ_AVAIL); +TRACE_DEFINE_ENUM(OP_CB_RECALL_SLOT); +TRACE_DEFINE_ENUM(OP_CB_SEQUENCE); +TRACE_DEFINE_ENUM(OP_CB_WANTS_CANCELLED); +TRACE_DEFINE_ENUM(OP_CB_NOTIFY_LOCK); +TRACE_DEFINE_ENUM(OP_CB_NOTIFY_DEVICEID); +TRACE_DEFINE_ENUM(OP_CB_OFFLOAD); +TRACE_DEFINE_ENUM(OP_CB_ILLEGAL); + +#define show_nfs4_cb_op(x) \ + __print_symbolic(x, \ + { 0, "CB_NULL" }, \ + { 1, "CB_COMPOUND" }, \ + { OP_CB_GETATTR, "CB_GETATTR" }, \ + { OP_CB_RECALL, "CB_RECALL" }, \ + { OP_CB_LAYOUTRECALL, "CB_LAYOUTRECALL" }, \ + { OP_CB_NOTIFY, "CB_NOTIFY" }, \ + { OP_CB_PUSH_DELEG, "CB_PUSH_DELEG" }, \ + { OP_CB_RECALL_ANY, "CB_RECALL_ANY" }, \ + { OP_CB_RECALLABLE_OBJ_AVAIL, "CB_RECALLABLE_OBJ_AVAIL" }, \ + { OP_CB_RECALL_SLOT, "CB_RECALL_SLOT" }, \ + { OP_CB_SEQUENCE, "CB_SEQUENCE" }, \ + { OP_CB_WANTS_CANCELLED, "CB_WANTS_CANCELLED" }, \ + { OP_CB_NOTIFY_LOCK, "CB_NOTIFY_LOCK" }, \ + { OP_CB_NOTIFY_DEVICEID, "CB_NOTIFY_DEVICEID" }, \ + { OP_CB_OFFLOAD, "CB_OFFLOAD" }, \ + { OP_CB_ILLEGAL, "CB_ILLEGAL" }) From patchwork Thu Jan 25 16:29:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531250 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DE267762A for ; Thu, 25 Jan 2024 16:29:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200172; cv=none; b=D5OvdKT7T97Dc50dALt+43r/YRffD5nf7SeRRJ+aTQGvFE1xAjsWx932L5ery8yEh4EdpMjqLeP5cxAXDpJmSz5sFprEffat2yxVCV4WqYa/qvlNFBEfSe3O2ckNlAUzdwvd/+A5XV9218Dw38DqXdEiuaGVjpqRVXj4p+/gy7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200172; c=relaxed/simple; bh=IVm9gC/HXqfW9zXKsDv/2CJOVlAZXs7GZ8lO/1zrY60=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TbgF/ZyOpdr/clcfwX9eBXveebjXoXzJW0HtdOP37dL0hBp7/9lnI9RqvLWLEHVaWRwuMdtExlhRxh7tiS93jxVga1T/5BInX6lzqgLiBWkQUAfJkc5lsyHEm9LdxuXxvx4vqaguWMrkRnznI7o6RTZuajrY895Pot70S5h1zLY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DjMcTMCH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DjMcTMCH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E764EC433F1 for ; Thu, 25 Jan 2024 16:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200172; bh=IVm9gC/HXqfW9zXKsDv/2CJOVlAZXs7GZ8lO/1zrY60=; h=Subject:From:To:Date:In-Reply-To:References:From; b=DjMcTMCHOvUyXGtClc3swin/Dp3hYkBATYP4WOcvr16oBb7+AxwmsIOeFGlCfUNFZ Bh0ZRO8qgOpkQpMnlWSa7nybLQIUKIgiHYww9GS9e0FCHznvT0lVxqPfeLp4RHGDWZ VTAGi/Uicxh0XPUAzlWkdQyuhtRTpB6TwFqoc5jVGY7U7o1aVtkWPVx2V6QcA0XfG+ DJ0JAosPH9ZgM3ChNT73a7AaKpqSiWNU1IznVQtCHBKhyjNvLMdBj+sC5OnT9MUXhB 8fi2x/40yIKKdamRQoFNFOsqwq4OVjC7mZSkn6NA9qIwC7J+BGuINp7t+Q5MRm2NMI U/IbJMQ3EvWeA== Subject: [PATCH RFC 08/13] SUNRPC: Remove EXPORT_SYMBOL_GPL for svc_process_bc() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:30 -0500 Message-ID: <170620017090.2833.16348897334568590465.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever svc_process_bc(), previously known as bc_svc_process(), was added in commit 4d6bbb6233c9 ("nfs41: Backchannel bc_svc_process()") but there has never been a call site outside of the sunrpc.ko module. Signed-off-by: Chuck Lever --- net/sunrpc/svc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index eb5856e1351d..425c1ca9a772 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1603,7 +1603,6 @@ void svc_process_bc(struct rpc_rqst *req, struct svc_rqst *rqstp) WARN_ON_ONCE(atomic_read(&task->tk_count) != 1); rpc_put_task(task); } -EXPORT_SYMBOL_GPL(svc_process_bc); #endif /* CONFIG_SUNRPC_BACKCHANNEL */ /** From patchwork Thu Jan 25 16:29:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531251 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92809129A7F for ; Thu, 25 Jan 2024 16:29:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200178; cv=none; b=VSEEMLhjLn6PByN3KRq5s0EuSoBWIdVYQSFp0/y2oebZAzvhYp/8Op5CYCOANWaVW1JYBw2mO/5teElBP5sOUp7AbH3b2T1megMPanpIqC6IaVcUZx3ixFVih8+gl876gyYOdMQkgud2nfoNH0QOqMXsk9BNbGEBMDB3qC3ChfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200178; c=relaxed/simple; bh=RnwNa/0CGb6w/Vo/tNyqewdpbgimrJQy3qMYF20ggjw=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GnY7b1JllfkTDNl539Re7O/PvJdL/ctUJAEE3Y1+RiUX84vxy6ojUVpWdX9unkvc85SrJ6WJ7sUsPUJ5mHyPfuwz1Fo65DjQMR25QmaOzFp7uVWicLZyiw/gBm0nAjjTRneXMRbVHLOmRFbQYMwrEpua3CjwVQ4dwcKObpTSnKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OWtj3MYb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OWtj3MYb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B528C433F1 for ; Thu, 25 Jan 2024 16:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200178; bh=RnwNa/0CGb6w/Vo/tNyqewdpbgimrJQy3qMYF20ggjw=; h=Subject:From:To:Date:In-Reply-To:References:From; b=OWtj3MYbVI/NSwQAVvN9tuZtp8+IuW0VNOOT0m0S2fLmXmycMpBOQjJ0f9vivXO+S mIgZR2dYC7IhHHBX5O0U/UDmh1BFuNUj/lIT2qNCa1dgVaXOrR8KPFfsikfaVFRbIE KS1henXcSdFnV16LEpwyofdzX9OtN/v+Oe+a5SavGukIxnlRKAiNPHWWudbYZI9xtA WJvGia+aTZlcRYf9OqORjqySbJC4JD7/6dLuA901WtCwJwSwTTUbzxcbfB2887vVmZ oh65fZ1r9oEfuA1QJhutdDktqcxpCDu5QyJJ/btHSk7ULIMJrrMOgrqeI+f7NcfHk1 Ga1cHk93YR94Q== Subject: [PATCH RFC 09/13] NFSD: Remove unused @reason argument From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:37 -0500 Message-ID: <170620017728.2833.11292919673014701709.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 4d5a6370b92c..1e0f5a0bd804 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -45,7 +45,7 @@ #define NFSDDBG_FACILITY NFSDDBG_PROC -static void nfsd4_mark_cb_fault(struct nfs4_client *, int reason); +static void nfsd4_mark_cb_fault(struct nfs4_client *clp); #define NFSPROC4_CB_NULL 0 #define NFSPROC4_CB_COMPOUND 1 @@ -1004,14 +1004,14 @@ static void nfsd4_mark_cb_state(struct nfs4_client *clp, int newstate) } } -static void nfsd4_mark_cb_down(struct nfs4_client *clp, int reason) +static void nfsd4_mark_cb_down(struct nfs4_client *clp) { if (test_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags)) return; nfsd4_mark_cb_state(clp, NFSD4_CB_DOWN); } -static void nfsd4_mark_cb_fault(struct nfs4_client *clp, int reason) +static void nfsd4_mark_cb_fault(struct nfs4_client *clp) { if (test_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags)) return; @@ -1023,7 +1023,7 @@ static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata) struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); if (task->tk_status) - nfsd4_mark_cb_down(clp, task->tk_status); + nfsd4_mark_cb_down(clp); else nfsd4_mark_cb_state(clp, NFSD4_CB_UP); } @@ -1175,7 +1175,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback break; case -ESERVERFAULT: ++session->se_cb_seq_nr; - nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); + nfsd4_mark_cb_fault(cb->cb_clp); ret = false; break; case 1: @@ -1187,7 +1187,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback */ fallthrough; case -NFS4ERR_BADSESSION: - nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); + nfsd4_mark_cb_fault(cb->cb_clp); ret = false; goto need_restart; case -NFS4ERR_DELAY: @@ -1206,7 +1206,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback } break; default: - nfsd4_mark_cb_fault(cb->cb_clp, cb->cb_seq_status); + nfsd4_mark_cb_fault(cb->cb_clp); } nfsd41_cb_release_slot(cb); @@ -1252,7 +1252,7 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) case -EIO: case -ETIMEDOUT: case -EACCES: - nfsd4_mark_cb_down(clp, task->tk_status); + nfsd4_mark_cb_down(clp); } break; default: @@ -1374,7 +1374,7 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) err = setup_callback_client(clp, &conn, ses); if (err) { - nfsd4_mark_cb_down(clp, err); + nfsd4_mark_cb_down(clp); if (c) svc_xprt_put(c->cn_xprt); return; From patchwork Thu Jan 25 16:29:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531252 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0474077F02 for ; Thu, 25 Jan 2024 16:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200185; cv=none; b=O5dCfLtGAKAhioBG0SUO40NRfcuhUbwB8NCZrOOX+fEG+Wlth6fWjJ+TlpqkjcvDQYHPQ4jmWcfqDSkKV5o1KgTmTU7CAPAa4qSmFjeFiu1/zkoTSURs+nhw82FUjKXbGKSIdAJV6fL9rXFgmzdrbkz3SflRnptAspkr1AEwx3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200185; c=relaxed/simple; bh=xV/8d6un0tZ1MxJIl+otAu/VWHtxWRlLP0tqM9ypkAc=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pF5zpJdXxEfkqM/cw8BiogRtPgiyE4SErW0K2JMEFmyuAcRLFOvGLZ+V0MHp90yu8WTne75nyarOWHkGJMlx8j25Gg1x7XmhjxOsSNq2VvAY1r6vKn4eHngzEZShfs6VRCzfLUIEQzOBJEAs8WZCYb8H2/yalBcJrA4OEbfvqy0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nl9cmo6U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nl9cmo6U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B35BCC433C7 for ; Thu, 25 Jan 2024 16:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200184; bh=xV/8d6un0tZ1MxJIl+otAu/VWHtxWRlLP0tqM9ypkAc=; h=Subject:From:To:Date:In-Reply-To:References:From; b=nl9cmo6Uqk8nKHHWHEj8WNV/y6hZPpcfUb1yquqZGCE0uaxBcIOD9fM58qaaT+Jqe kW96J4oND5Zvtuq670JSVxn14tHPJq2H7upIu5lTwh6WxWK37HspHHNNHxwkZikT1G jN/eW+MnyTNYvQ47F056veUvjVp+jQvDLoDJj+loGBpeACFVIryHjIMAfdh07+1JkS WNIIwXB2c52uupSFRMbFsL5DTakhk/Ib4xp8Ttt6HnSfsPUXI7f39SeNltBNY+1kk/ bC9HBYec3Y7bf0RAMZPXoIG20jcPil2sjpm8IfmI6XiipZNwC3yfr76JHeMswiZ/Ke 9qdlHgHRPxzUQ== Subject: [PATCH RFC 10/13] NFSD: Replace comment with lockdep assertion From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:43 -0500 Message-ID: <170620018365.2833.3114414936937483602.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Convert a code comment into a real assertion. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 1e0f5a0bd804..dc308569bc31 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1307,12 +1307,13 @@ void nfsd4_shutdown_callback(struct nfs4_client *clp) nfsd41_cb_inflight_wait_complete(clp); } -/* requires cl_lock: */ static struct nfsd4_conn * __nfsd4_find_backchannel(struct nfs4_client *clp) { struct nfsd4_session *s; struct nfsd4_conn *c; + lockdep_assert_held(&clp->cl_lock); + list_for_each_entry(s, &clp->cl_sessions, se_perclnt) { list_for_each_entry(c, &s->se_conns, cn_persession) { if (c->cn_flags & NFS4_CDFC4_BACK) From patchwork Thu Jan 25 16:29:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531253 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6727129A8C for ; Thu, 25 Jan 2024 16:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200191; cv=none; b=ebXfWt5zxpynyPOFT7tdFxK32wSTJnncHbNqgHa5Qlp3MjtVv75+SJJfRg16sIjcaJ55vXsxBEzJkecq7Odo1J71ewLEIPj0Kwq5cCqdzsX8O9y5hnQ1fEYIWvm/kCj/UKTbCcx+F4jLb02U1gXsYg2DmolwnT+dN7jSklR2Wj8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200191; c=relaxed/simple; bh=ew6rJvn++WxXwaCqxrMp1ipSOssALPhsQhScx9b3X2M=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D4k5zllqgB40uLo91v62958zreVSV9eAVHCgjVk5Vdx/CyKsNEabgvdXmMpLdJFQBPHp0gJjGJJq3bLDaaW7UcdrTcbB2YfePnSdFFVmwhT9kbjGMKbJRlBWTROMLKHJpgMxEWTXXBWv7dXjztI/Ck6999gVJL66BFS5wrrRZsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ihIWLL47; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ihIWLL47" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22603C433C7 for ; Thu, 25 Jan 2024 16:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200191; bh=ew6rJvn++WxXwaCqxrMp1ipSOssALPhsQhScx9b3X2M=; h=Subject:From:To:Date:In-Reply-To:References:From; b=ihIWLL471WT47GxjlATJnMl7COB0V5APnIFCZs9iOiWgcap5XlyWJLmgS4XjB97yl 2x+q2sNChaVM1B0/+uzKKmSk1pDchfJkC8YMSvug7EB7PdOSoVEs348caVVyf2NMOE sYIMcG5QMngiGvUqcwOncEe9OCqGA6CMRC7e4ckqFx3aYIG+z14YabZWZHi5L+GUKC QRho558NAvZM76jQ5LbOgnjwAQSEX6V0iwOoR0K/YVHe3JU8+/itIhaQ+g9wxBm1dc agpZHGj9PhmQP+fnxc/zxzIkXYh379qKCsTH1Zq3sDucZP3F+gZBeRRzYBpZ7auAk4 /szwtrmfpeP9g== Subject: [PATCH RFC 11/13] NFSD: Remove BUG_ON in nfsd4_process_cb_update() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:50 -0500 Message-ID: <170620019007.2833.17281344766250004438.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Don't kill the kworker thread, and don't panic while cl_lock is held. There's no need for scorching the earth here. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index dc308569bc31..46ecb3ec0f8f 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1362,8 +1362,9 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) * Only serialized callback code is allowed to clear these * flags; main nfsd code can only set them: */ - BUG_ON(!(clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK)); + WARN_ON(!(clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK)); clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); + memcpy(&conn, &cb->cb_clp->cl_cb_conn, sizeof(struct nfs4_cb_conn)); c = __nfsd4_find_backchannel(clp); if (c) { From patchwork Thu Jan 25 16:29:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531254 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0118129A70 for ; Thu, 25 Jan 2024 16:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200197; cv=none; b=OUT32IDhiV1cmXT9KLJ2Hg8ykXe2DpGviIJ3QWuvpFI7zn26rTpTBlvtM4ZnQejq3xM9tl4HpojSwN5Kbofb2OibuPc7ODiRjqKFamL/vQavvCI+KCUs6Kdye0dZyE/sOqcs24wJp32ghmQ9GFGWUYsAoELMCaXdDhibaVKTGXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200197; c=relaxed/simple; bh=fCulokz3BjzzNImUyQKnWwQdKoAXzN2sH7HV8gn//l4=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y3CNitWs/TLj6xVIpPJJlK/cDEb3DpaeSHGCzECsJIxaQg7SEXxHbZoU7DjrIYThfVXMAmpGyX10Z7MP7d/A5fx7EIL88Je4Yemvm4jDZUw6AUrQsISXsxFRuuSDWJKOwOn/CWOqD/mCTFd6c3h4nnwhf0yO3HPz3JTI6GV9CuI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MJeXNzDg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MJeXNzDg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68507C433F1 for ; Thu, 25 Jan 2024 16:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200197; bh=fCulokz3BjzzNImUyQKnWwQdKoAXzN2sH7HV8gn//l4=; h=Subject:From:To:Date:In-Reply-To:References:From; b=MJeXNzDgl/yqC3yjexDWlTLF0gKUVvTehsvTVAED1nYOSNcwMsz6BJVQt4G9YFdsl uF3PQZI7hNiMLq1Ca4qG3fVWdKw89H1QX3goBqNxiv0mdHTlKShYQnS+eoGskx7IIe +/PX+eE7KuWnL0yU/SL6QsuCDW/svBOusoRKL/qiehhNYrQR+AjIt9BOU73/CNkIGr xKe7vUYOxpZfOZvQOm7tgqtZxAkUKSugbSzn2cMfIXVhxibcL59uv2FhiykqefjkOW ifvskCcix030cV4GqMAsPJTZOGTZDC7wnEg5dvMLIyUzGPw/hmvGIU1AoGGlrPNCRr czGgFCFOx9QdA== Subject: [PATCH RFC 12/13] SUNRPC: Remove stale comments From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:29:56 -0500 Message-ID: <170620019647.2833.15727263058832480637.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever bc_close() and bc_destroy now do something, so the comments are no longer correct. Commit 6221f1d9b63f ("SUNRPC: Fix backchannel RPC soft lockups") should have removed these. Signed-off-by: Chuck Lever --- net/sunrpc/xprtsock.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 58f3dc8d0d71..d92c13e78a56 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2987,20 +2987,11 @@ static int bc_send_request(struct rpc_rqst *req) return len; } -/* - * The close routine. Since this is client initiated, we do nothing - */ - static void bc_close(struct rpc_xprt *xprt) { xprt_disconnect_done(xprt); } -/* - * The xprt destroy routine. Again, because this connection is client - * initiated, we do nothing - */ - static void bc_destroy(struct rpc_xprt *xprt) { dprintk("RPC: bc_destroy xprt %p\n", xprt); From patchwork Thu Jan 25 16:30:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13531255 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EAF77316A for ; Thu, 25 Jan 2024 16:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200204; cv=none; b=dl0c+dms6IatJPMiHx0pp0e3fS+MQUX5qWREs/nVXUdMgwkYtFTZBpJF2pAY2XjQUgsxjU1Yki8PgO6yMiQ5axRVnQNs8JQL6XFf6gcU18m1Ne3ekqabh/CWpoBQaaPBwOyYSC/XuOeaSBPBsWFIP+EwRus6L4/7cL+gD3V1Af0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200204; c=relaxed/simple; bh=7l4u3xIr3J7Fi04C0U1HFphRw43b5KA1MPBxqwGcSd0=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iTEzm9LX2GX9e1qDTxfXvZm5AvO9/CLn4OC6ekvVV2sxLH0nsEOQnHSG1bVw3Ms4bb7OjBSP13vm+FtVA+mcg+6bRxFEQdQ/KE3NzGjHP2yeIVSDiSkpgPmpAUmN06xvP6drycrNoKWkEeM1noCbbu5TuGIVDOWRyMMImgdh0gA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MlK5ZxFu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MlK5ZxFu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7A0C433C7 for ; Thu, 25 Jan 2024 16:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200203; bh=7l4u3xIr3J7Fi04C0U1HFphRw43b5KA1MPBxqwGcSd0=; h=Subject:From:To:Date:In-Reply-To:References:From; b=MlK5ZxFuuGwPC7GZxS75i6Ck3fe+bDVRsAgnZ/ADVBrEj6GVp8jffFQXfYAdSu8HC pGmFatHSAuAfgnt6MTKXChb6iQeggTr7kPr0yC91H/WHs+rYQyxUpKLWkgMGQ/J678 GBEaY3qWusXoSHhabowf+xh4bCXNq8/2OXiFNHYDT9kKgY4nT+xJBbyWNcMP2KC7Gk QLbNwhxbyXtSblXK9csxmmUwFtrtf1hGK4wlmMfYSFniHq5fvWa/gg4PMSwrJGxFSu oB7RjhJOsSyR0ZUtGbR3sOystfXxdsFr6fp4UYYw+sBHUZlVYESMgF/NRD8Ngrjwck 555AympTEhk0g== Subject: [PATCH RFC 13/13] NFSD: Remove redundant cb_seq_status initialization From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 25 Jan 2024 11:30:02 -0500 Message-ID: <170620020276.2833.13226851823042560273.stgit@manet.1015granger.net> In-Reply-To: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> References: <170619984210.2833.7173004255003914651.stgit@manet.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever As far as I can see, setting cb_seq_status in nfsd4_init_cb() is superfluous because it is set again in nfsd4_cb_prepare(). Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 46ecb3ec0f8f..e72a904f120b 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1443,7 +1443,6 @@ void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, cb->cb_msg.rpc_resp = cb; cb->cb_ops = ops; INIT_WORK(&cb->cb_work, nfsd4_run_cb_work); - cb->cb_seq_status = 1; cb->cb_status = 0; cb->cb_need_restart = false; cb->cb_holds_slot = false;