From patchwork Fri Jan 26 17:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533080 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 7CA2A20320 for ; Fri, 26 Jan 2024 17:45:18 +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=1706291119; cv=none; b=S/u+NCma8iwoLmJOXgK7sd2S02hvuUMm7+Y1U5mlkJP34gda6ShP2J1w86CtuJt2CfOZPPYFgfZdqJhPwOJDqvb34Gc/qUpA08Y4ZVhP7OmMdStrGWuGFQaH4TMNA10cPoNU/iNvcEc+VyaFYE2olzBfNBV2fVURHNhY2ijA8+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291119; c=relaxed/simple; bh=AnkpOGIQFWkJ/JOeRn0Nu3/dEqNIgTVSo7LYtNBt3EY=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nF0DpwA5HUaOCqfz9QsEWLQS8MXoYUkvNbgf7xpYw9q0+IkYZ2c85An+6Vm5R2/ZWboUuQx7iWahLWj+8ZET3DXcJpNxmjBjNNoLnqIko8x08/Gfj2MbhkdxUq5OQ259CubFRG8jI+dkW7sYtQ+R6IDV2ol81YtgqHikJcbXbVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OL3rzoOz; 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="OL3rzoOz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5F18C43394 for ; Fri, 26 Jan 2024 17:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291118; bh=AnkpOGIQFWkJ/JOeRn0Nu3/dEqNIgTVSo7LYtNBt3EY=; h=Subject:From:To:Date:In-Reply-To:References:From; b=OL3rzoOz/H6VMA6xM3WWRb3LyUCcWzKPTRB6dY2YWl0zHnfezECIuv0GqcvPjqU3F VSLc+uV6MJFuoyN+HxE3NC6MGYRC552D5QhjaBrjsmcmorkN94iaPLjnuWQKAXJUfB e8RTVtGFHdoSFY3xXkbrcllEGplcOqU1N/xWH/YyMTrFhnF4qyBGjQBOILuFZ+fq+B j5+6rtv/S2OPGuJftWvFN/I+2BkRIORcHjKmDe3k5iwhRx1X4DAN0q8grdhGurvR1N 3w1CkehrqwsKVI97ECZNgXfz9/THGmv+XxunuUWjUER0I55OUvxsrxVreWYfeOtMPy mjBguEZJwbeRw== Subject: [PATCH 2 01/14] NFSD: Reset cb_seq_status after NFS4ERR_DELAY From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:17 -0500 Message-ID: <170629111684.20612.8595881042301584822.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- 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 Fri Jan 26 17:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533081 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 13A2C208BA for ; Fri, 26 Jan 2024 17:45:24 +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=1706291125; cv=none; b=aGFaA0Wpz/Er/yH92ZYuBh2bJQRQ90G5FHy1qf7zHaB5yCQP5gTlWtaVmBdi/HHhzfSCPIhRzMkievYb3BwXIlqHn29w2qTsyxEdQfj2LGSmhM/6RGOZlaQnfm8aG2ictlNhma63HLtEGSpSxfX1lTkLhWm/NzeFNI5AKnfNcrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291125; c=relaxed/simple; bh=fvaiBK3PyaNdQ/1DEAZsRSMGJZ0XyMNPJw/0OTMTGMM=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BDOjvCI+nFnaPOHOZYHONiN7gwKbXl7noxsx+nEgLChUXb1hdEU3769gIbWOV8MCL42tTie9G2j1WsW0GxFMjejNlB/wUmZ9ZyZuupK9x7y207A4bkrOgttZv2j3SrVXmFSTHuWbfJbr1V+XjVx0fXvv9hEUvaCYNgmHFovoe0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZFm7nDf6; 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="ZFm7nDf6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56DD7C43394 for ; Fri, 26 Jan 2024 17:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291124; bh=fvaiBK3PyaNdQ/1DEAZsRSMGJZ0XyMNPJw/0OTMTGMM=; h=Subject:From:To:Date:In-Reply-To:References:From; b=ZFm7nDf6tP+fOUCTD/uG/z7pAEzazRUHH84zZSJS6Y6CCylvDwEHbVEUpBKC6T6Y1 6fswHhXQcash8jnBbGQxTiGYjMVmTFIQk/ZX8vx72rfC6JgmnHGoZjRAEzbruBvOX2 hEDjF7auo+/lCk409Ce9f17TzQh06fTQaQ9C9uRGYm1ZFKRZRg6UQK5GEmD9HBw1km pC7Lb6EQVEGQ/7lpru6GWDTHd7K2O3lqcEqnVNWsheQJiWmLxefGLPx75Y+evYwZ8z iYI9epuRI1+AYmRTqGpzqWLq5I7jmNAYG3gXJgYTokduuWO817V++exe+PDPA/R1Kf l/T+DZARw5qQQ== Subject: [PATCH 2 02/14] NFSD: Convert the callback workqueue to use delayed_work From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:23 -0500 Message-ID: <170629112325.20612.15691160218281370004.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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 Normally, NFSv4 callback operations are supposed to be sent to the client as soon as they are queued up. In a moment, I will introduce a recovery path where the server has to wait for the client to reconnect. We don't want a hard busy wait here -- the callback should be requeued to try again in several milliseconds. For now, convert nfsd4_callback from struct work_struct to struct delayed_work, and queue with a zero delay argument. This should avoid behavior changes for current operation. Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton --- fs/nfsd/nfs4callback.c | 6 +++--- fs/nfsd/state.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 43b0a34a5d5b..1ed2512b3648 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -887,7 +887,7 @@ static struct workqueue_struct *callback_wq; static bool nfsd4_queue_cb(struct nfsd4_callback *cb) { - return queue_work(callback_wq, &cb->cb_work); + return queue_delayed_work(callback_wq, &cb->cb_work, 0); } static void nfsd41_cb_inflight_begin(struct nfs4_client *clp) @@ -1370,7 +1370,7 @@ static void nfsd4_run_cb_work(struct work_struct *work) { struct nfsd4_callback *cb = - container_of(work, struct nfsd4_callback, cb_work); + container_of(work, struct nfsd4_callback, cb_work.work); struct nfs4_client *clp = cb->cb_clp; struct rpc_clnt *clnt; int flags; @@ -1415,7 +1415,7 @@ void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, cb->cb_msg.rpc_argp = cb; cb->cb_msg.rpc_resp = cb; cb->cb_ops = ops; - INIT_WORK(&cb->cb_work, nfsd4_run_cb_work); + INIT_DELAYED_WORK(&cb->cb_work, nfsd4_run_cb_work); cb->cb_seq_status = 1; cb->cb_status = 0; cb->cb_need_restart = false; diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 41bdc913fa71..87c4372ba36a 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -68,7 +68,7 @@ struct nfsd4_callback { struct nfs4_client *cb_clp; struct rpc_message cb_msg; const struct nfsd4_callback_ops *cb_ops; - struct work_struct cb_work; + struct delayed_work cb_work; int cb_seq_status; int cb_status; bool cb_need_restart; From patchwork Fri Jan 26 17:45:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533082 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 59F29208BC for ; Fri, 26 Jan 2024 17:45:30 +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=1706291132; cv=none; b=U9FFeP9uAqznH4P9JnpolOxTwSnUF/w+TuBpOy5L4VP1HZYhgQFfGM/QMqVwPjb6aS6Xf8P9esv0bn+TWTi5mG+zkJOt1lErwjMWp507IdCe6ocjOfECHsi1VRMmRLpekMFHBfsDfDG7SktVdB05m33URotOjvQ1jB/gxlFRt+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291132; c=relaxed/simple; bh=mF7dux60dMpAU6FPXOAtOEcVq3Hty/2INAqzdyqD1KY=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jTC15DEnI+43/hN4oTqr0Qjqejumeo+LSPQ/ZABdqpdS0XzMus+hk0+STI0fJgFKHZNVj/wohUojqsMtQ7Oye0+vWAY/87XtDPzr5ENyL6p4dFt+RYiS6cKnBeoz8dx5PKoe0tf9hopGSMr+BBuwICNpk6Yma2I8r7U344MHsxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QdR5bvtt; 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="QdR5bvtt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD07DC43399 for ; Fri, 26 Jan 2024 17:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291130; bh=mF7dux60dMpAU6FPXOAtOEcVq3Hty/2INAqzdyqD1KY=; h=Subject:From:To:Date:In-Reply-To:References:From; b=QdR5bvttXdOSh7PMZPNmjBejDYl1VJBHOTo0ov2M2EC7jt12qBCo9Wp1gRBaoQGKs 98kC3O/O/wYDUqGoCb6f8UMZ5rBT4h28V8BtTjQqRUfCjGDrKTP2WDYKnVwsM1KgyY 1xqhS18Jugb004qDaNedFYJe6qbzI/9TGuRUFYYZXrvKxl7QI+1imiyP4KoljR5zGl BmSlGPG+6Xp9+KAkHjb0VMOGArkimF6pDQ4GEoSSCf4LWutD6YsNUKlf6IwEUZyz2H b3dtxU4UmUmem2w9OnApGkz936NT9aJ8qoRoeAMQS+TT2iXGFCSvCtV1LOqRQbwjgP ujRhv0dBuREUQ== Subject: [PATCH 2 03/14] NFSD: Reschedule CB operations when backchannel rpc_clnt is shut down From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:29 -0500 Message-ID: <170629112969.20612.8526400738389878628.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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 Reviewed-by: Jeff Layton --- fs/nfsd/nfs4callback.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 1ed2512b3648..389d05985c52 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -890,6 +890,13 @@ static bool nfsd4_queue_cb(struct nfsd4_callback *cb) return queue_delayed_work(callback_wq, &cb->cb_work, 0); } +static void nfsd4_queue_cb_delayed(struct nfsd4_callback *cb, + unsigned long msecs) +{ + queue_delayed_work(callback_wq, &cb->cb_work, + msecs_to_jiffies(msecs)); +} + static void nfsd41_cb_inflight_begin(struct nfs4_client *clp) { atomic_inc(&clp->cl_cb_inflight); @@ -1375,20 +1382,21 @@ 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 could wait for the client to + * reconnect, but I haven't figured out how + * to do that yet. + */ + nfsd4_queue_cb_delayed(cb, 25); + } return; } @@ -1401,6 +1409,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 Fri Jan 26 17:45:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533083 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 C8A76208AF for ; Fri, 26 Jan 2024 17:45:37 +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=1706291137; cv=none; b=AomHI2cLaNcQ6dy3wkipu21R8MywP+vDQIjSqOwB2Sl7II6bQAXthh8pKCo+n83Pc9P9BrzcsebzuyAmUO49EPMjMIp37v/R6RtGTcMZvFe4VppJYwo/sg2cZUI7VAak731ldQBnowSV1mADpRImagWv/e3O1ISZzTijqhKPpbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291137; c=relaxed/simple; bh=VAqV5QdMwCWU4OPpYvQoSiOmWp1CcqeLrzhrccIsBx0=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sQTZZVKFwpz13+UDkParGSSM4jVmdcNL4Hwd8YKcIW/erxTTDAgAEovFrQuJMXEl9zmnR7D5hV3Vbap1WFeJzGVcpdZ7RL6QM0g6Oe8eXWXvki0da2wur+5nNa1aIQ9OTSssU5SDVt1+tHcPW67aNEzbrv9cXfL9KZDnBfUqWI4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s/bhFtCA; 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="s/bhFtCA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F11EC433F1 for ; Fri, 26 Jan 2024 17:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291137; bh=VAqV5QdMwCWU4OPpYvQoSiOmWp1CcqeLrzhrccIsBx0=; h=Subject:From:To:Date:In-Reply-To:References:From; b=s/bhFtCAl8yGTDSx/3g4p4lrw5yqeeziEmdqFRg2DYlj4GXDBV1RsJ1bary+OZNwg uJcEXhWM8bgm4IZMunGWNvMi8rBhhagtFZ7PI4CZ1F5hEILRQNfLzts8n3gRSVCSKV FJHFn8805y+v8mJTiA0rRDBkH0ZIzCNWZMQgeh29tsHpGiElgahMC8/xHoGeDMwBlm 2Z1PW/Ria+LiyCsaLJOL7xRFzL/uFP0OaQAEGLq8Mnjg9PydI49OVGhF4T2kN8lK1s WbfJWRGy8k9sJXGQ+7gQQIGEnknHmscEnKu6YpLLR95/1NzZLpnzMfE7vPbDVFKFzO FIl4Y2QovDTAw== Subject: [PATCH 2 04/14] NFSD: Retransmit callbacks after client reconnects From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:36 -0500 Message-ID: <170629113601.20612.5705156104404285555.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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") Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- 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 389d05985c52..3bff14241b3c 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1178,12 +1178,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 Fri Jan 26 17:45:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533084 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 D82CF208A7 for ; Fri, 26 Jan 2024 17:45:43 +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=1706291143; cv=none; b=sGJ7WSgnLw3tw+6fSw27ZIGksOOjHymSQuBGd7dtX2tlPtWbcn7mjbHB5MPWdog5we1p7RsJClqJSRFqQ8/CK95z37Mssgx0SCEiZCnvyYUyaoaGfWlrgmUQOc2sI9dNMV0QnlGGGFFkJgRK05WwFUtWem2XwDIpHUtdQtDRom0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291143; c=relaxed/simple; bh=cr/g7ElMEoUZAmCdl0hrZBH1qX2uPnDEWweEB9gQNfk=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bv6+u38S8vjT3Ue7klKS+fxkq4GIGepGzNG7uVUGLkj31bzXXnn9+BL0uc5bKCLz6RG3eHyINmnpPO1Ls6Ag/5bCXOvy7mzZi4nqJocq55Og7hxPHY7jU3m98jUY+sUvlURrad6H9PeYA0rwu5WX4ClifI52T0MRhlbRXP6hKXQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EJwpLSad; 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="EJwpLSad" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AAABC433F1 for ; Fri, 26 Jan 2024 17:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291143; bh=cr/g7ElMEoUZAmCdl0hrZBH1qX2uPnDEWweEB9gQNfk=; h=Subject:From:To:Date:In-Reply-To:References:From; b=EJwpLSadWI1G1mDww/iRlujv4plpo3ai/m2hG6K7kiHj4fU/61UVikSiYDYeKDOwm dehm0muH/OqBLej0NL0ypbjU7TCJdln3mUXdcbxzzeZc8QDsFzajyABOwxTBMt00JQ vVYEfQADhx+vnEhgabYsMiOetVjjLiICV1dkd4CT30YCUyKOX8/7ZaqgSVbwWqOfRK wGc64Gk41B2LIhpYVn779Ih0yB2bMEnUpHeos4sZRsudq/wYCGaIMGDAVJRdxS+KVQ zcH6qfTSGKMueC0GmITzG5VSG4Hb0Egnni3+nePRuKJPmPKFzUXMRDMxRMDWs24mcL IotX1rl2ghH9g== Subject: [PATCH 2 05/14] NFSD: Add nfsd_seq4_status trace event From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:42 -0500 Message-ID: <170629114243.20612.6785316387431284189.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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 Reviewed-by: Jeff Layton 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 Fri Jan 26 17:45:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533085 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 324EB208A7 for ; Fri, 26 Jan 2024 17:45:49 +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=1706291150; cv=none; b=PzzNQqrY6Ov3V55cJzRF+yQviwBWx6PIucvvp4bAJ7ctpjoKcSAV3lJaRkGQwKncnw8jAI2pN/UPJFomv3jwxuag2J0CSVmcO8E9/TzUNVEdBrsoRheW1+h77ygYv8Jg0gnADdeWdZysqp1FmaY8LH8HPrOCz0H6tAMGQIz4aPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291150; c=relaxed/simple; bh=p6AHnFHKX18WddjVdsVpNt9qXCxw0HaBX+zRFxXcUZU=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aCjrjPjv924iuzAOpovtaHcRWsPJmgHCINFA3ApSpjoWJCX7p82wPSLL2w+M/P6lexLBM72Yk/wBhZGU1gcENSUKHVA4cZWJnBrsRThYPTWCKZFU3HMRfcl6QSiZnYL7meXB4E5TaLNyLeEKV4cn0iDIrpORXLgFhymXFmEb1K0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FaaRCeiL; 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="FaaRCeiL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DF29C43143 for ; Fri, 26 Jan 2024 17:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291149; bh=p6AHnFHKX18WddjVdsVpNt9qXCxw0HaBX+zRFxXcUZU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=FaaRCeiLkK0fHj8Re92ribO/2HSgWzDjIRg1esa94XyH2Zjbc57a3UPQEzEA+DAAh w43XD3ait6tq39kw7sbZaXKpDBzZERTSb7JotPkiUNRKLJ+bXw+STrw4iZtUiBZZ2K XtL6CvaL5UdmaPvzLhtIOlSa1LB43K/kkN/JspnPgzem/cCEnCjeLWaJIgeSdzFJTo KufcZmYdHEUTOOYRZgF8oJ2zMNgwBxHaBgsKE+yyDk8EICrhQTVhaByYmn7q2NHJ7b 26hxP6/9yRahCSCNT70Is1tIaIt4jmvjU/rRz/CbBTXbjBANm1db8rGf49p8Aiakk/ 7hsHHEBRZD1rA== Subject: [PATCH 2 06/14] NFSD: Replace dprintks in nfsd4_cb_sequence_done() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:48 -0500 Message-ID: <170629114861.20612.12626133349616644679.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Reviewed-by: Jeff Layton 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 3bff14241b3c..78d9939cf4b0 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1165,6 +1165,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: /* @@ -1210,13 +1212,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 Fri Jan 26 17:45:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533086 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 70B1120B03 for ; Fri, 26 Jan 2024 17:45:56 +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=1706291156; cv=none; b=Tkn4CyEeH204gEXy3H7hVAVvlNzrC2bjTDOXASfZZrsaCQvReA6bAKH5twFmYdohTbtKhPdm+xFtKqm7BF3l6BwH1QnCd4oxiuj2RrBeaMh7ujFLj4ittc+mQdPMxLBk0CinYiUTcipWChPiQgK34ZgFTqJE4UixQt8pvqJqFbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291156; c=relaxed/simple; bh=sGj1/p7XKLYshUz/QjtvupKf/QrZ0KM4wFbwT5oXQys=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G2k6kQqmA6Xo2p98d+GTi5WUYf3wQgGF3Wm9GiHusFZ8ynTerq4y9gB2BfW0dbqBpjwUh58w2cH/D/2SmNtm4HqcnM8hT40DMOGIM3v1VYvI9KJLRLih+oiZXbpT+kLfXd+YQM7gwBMQAivJF3xTu0+nSvXkAgNfHn6gsL/+9Os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jXf5SHsV; 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="jXf5SHsV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEA7CC433C7 for ; Fri, 26 Jan 2024 17:45:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291156; bh=sGj1/p7XKLYshUz/QjtvupKf/QrZ0KM4wFbwT5oXQys=; h=Subject:From:To:Date:In-Reply-To:References:From; b=jXf5SHsV2SwiKr1gVVO5TRhSohPe9fCurGGQVjIFgOO6Fl1X+nD0IiM+o77vHEt2V IegN8/7R1CIGVzkDiUU0SHJHCNYwwb+RCJoJ+6oOjoTnXNEBJHNjMrOnTK2Ru+J4UM jfTwVlp6pAFX2dKvXYklVcAOP4cwerPYH7mPCWYwYk8TvPg0bktcZS+ME/AnE7gTzy 2iyLeR7BIqNYK7e4JZiYmvSj/f/bb7CsAJ6NVMJdVNJq5jqOSe3ylBBwJ9UybP/zr2 FST48bDo/Qd8jR+gRx7H3Fnw48yLSzHGse42Kj5/cStIZWMTDUibul7A/yoyuBNAtr f+GYXKYzKnR+w== Subject: [PATCH 2 07/14] NFSD: Rename nfsd_cb_state trace point From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:45:54 -0500 Message-ID: <170629115495.20612.14499519793163904716.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Example trace point output: kworker/u16:0-10 [006] 2800.080404: nfsd_cb_new_state: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=UP nfsd-940 [003] 2800.478368: nfsd_cb_new_state: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=UNKNOWN kworker/u16:0-10 [003] 2800.478828: nfsd_cb_new_state: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=DOWN kworker/u16:0-10 [005] 2802.039724: nfsd_cb_start: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=UP kworker/u16:0-10 [005] 2810.611452: nfsd_cb_start: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=FAULT kworker/u16:0-10 [005] 2810.616832: nfsd_cb_start: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=UNKNOWN kworker/u16:0-10 [005] 2810.616931: nfsd_cb_start: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=DOWN Reviewed-by: Jeff Layton 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 78d9939cf4b0..a63171ccfc2b 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1006,7 +1006,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); } } @@ -1390,6 +1390,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 Fri Jan 26 17:46:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533087 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 6BCA120B03 for ; Fri, 26 Jan 2024 17:46:02 +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=1706291162; cv=none; b=mrksbRo17Yphc8RFaf8lel/h2LvlUwoat7P9RHuhfFYLcP2C4EcV0nByk8Cwzqt2pqF5b2NkZcKXiBHYFyKlVVnHm2Hac8KD4BVm+7RSLlNG6SZ2qMFm//LuFPDdm485kdWVjThXDmUtwaOOtc1UE55/J2TPaPINax6H5SWBdQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291162; c=relaxed/simple; bh=DkD/KcOBF8Z+mhx6XAKVG9fTU633JRqvcNiCjaWtq6U=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VisSXd2+wzdXx5OFKuLYeXaUdP+FzYEgXzPmbbaclaMs3GS51v3idWtcyT/mcVnibNfV88d7MW2uG8Bk4dTXJTrqptFe6oMWpmoIo8VxZaNFZSAWILQPzS0LSHARRc9T03J6mraaxQDE9Q6nH6KjczGtUD5QqY11gMIb836+lUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qDgCM3Zn; 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="qDgCM3Zn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2636BC433F1 for ; Fri, 26 Jan 2024 17:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291162; bh=DkD/KcOBF8Z+mhx6XAKVG9fTU633JRqvcNiCjaWtq6U=; h=Subject:From:To:Date:In-Reply-To:References:From; b=qDgCM3ZnKpW4hOX9K8V0n5YF0xOXUaDZSh9F04HiQYjytqK1FJ+B3Z/DRgKi7Fdib tIam3cHeiMpG19OuTkm0YXNaH1GjeH+2MSHV1fOwxR7v2X3N+qfbmGfnQswznljoD5 fDPZP0PWWj7y2OLqbFkm1o941maKvN8SMiDPJOW7IUNQW7eBMVJ9aNonEIzM/2izJ0 hRJh52aX5ugZ95d9LcXPNhC4fL/0cplfmlO1OuBVziH/7aC0+qJoBNiJ4C1QTGKsN+ TwJ3g0fyLLOHtWi3XA5iUQPgMH+1zh73UhqlQ1bBjGzf2SyczvBzKJ5JX0A5FHuFb7 bqCMd9DggF3iQ== Subject: [PATCH 2 08/14] NFSD: Add callback operation lifetime trace points From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:01 -0500 Message-ID: <170629116121.20612.7731503761991240803.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Examples include: nfsd-955 [004] 650.013997: nfsd_cb_queue: addr=192.168.122.6:0 client 65b3c5b8:f541f749 cb=0xffff8881134b02f8 (first try) kworker/u21:4-497 [004] 650.014050: nfsd_cb_seq_status: task:00000001@00000001 sessionid=65b3c5b8:f541f749:00000001:00000000 tk_status=-107 seq_status=1 kworker/u21:4-497 [004] 650.014051: nfsd_cb_restart: addr=192.168.122.6:0 client 65b3c5b8:f541f749 cb=0xffff88810e39f400 (first try) kworker/u21:4-497 [004] 650.014066: nfsd_cb_queue: addr=192.168.122.6:0 client 65b3c5b8:f541f749 cb=0xffff88810e39f400 (need restart) kworker/u16:0-10 [006] 650.065750: nfsd_cb_start: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=UNKNOWN kworker/u16:0-10 [006] 650.065752: nfsd_cb_bc_update: addr=192.168.122.6:0 client 65b3c5b8:f541f749 cb=0xffff8881134b02f8 (first try) kworker/u16:0-10 [006] 650.065754: nfsd_cb_bc_shutdown: addr=192.168.122.6:0 client 65b3c5b8:f541f749 cb=0xffff8881134b02f8 (first try) kworker/u16:0-10 [006] 650.065810: nfsd_cb_new_state: addr=192.168.122.6:0 client 65b3c5b8:f541f749 state=DOWN Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 8 ++++++++ fs/nfsd/trace.h | 42 ++++++++++++++++++++++++++++++++++++++++++ include/trace/misc/nfs.h | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index a63171ccfc2b..b50ce54aa1bf 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -887,12 +887,14 @@ 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_delayed_work(callback_wq, &cb->cb_work, 0); } static void nfsd4_queue_cb_delayed(struct nfsd4_callback *cb, unsigned long msecs) { + trace_nfsd_cb_queue(cb->cb_clp, cb); queue_delayed_work(callback_wq, &cb->cb_work, msecs_to_jiffies(msecs)); } @@ -1113,6 +1115,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); @@ -1227,6 +1230,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; } @@ -1340,11 +1344,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); @@ -1356,6 +1363,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 Fri Jan 26 17:46:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533088 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 13A8420B20 for ; Fri, 26 Jan 2024 17:46:08 +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=1706291169; cv=none; b=tz5ruOejCnF3pZkdy1/nIBcmZjuN/Agi45osmJlaQWJl2zNsg06yvJsu/BtjEOohG40xSngHDcvId3YAbhxXmqGJH4iJgtvqaTtnXX3TGg5BuJyfp5wVnbDtQBT21r9FImciatcEXmRACEFs5GAHsSlPlqqNRHwbnKDXK+0TE6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291169; c=relaxed/simple; bh=c0BGB+oDuEc2NmCcx8J2ZGunl0Ngy/MZZWAE9Z5KPEw=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZYvFIyvzgNCxV9Lxwc1IpfpsGUzBF2uj3TBAiOtTQUdYxK2WNfIKTkxHiR+mix1BxilpA+ucp6wHyODacmBdGMz3Vr9UsaythwgdlE5u6qAo1PtSxw1Kfa8004mn5RAUrh+gdnm734kBAldgOS6L5wsxe/XTG+eNgvGB3zocgrk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T1+dwJS6; 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="T1+dwJS6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70A45C43394 for ; Fri, 26 Jan 2024 17:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291168; bh=c0BGB+oDuEc2NmCcx8J2ZGunl0Ngy/MZZWAE9Z5KPEw=; h=Subject:From:To:Date:In-Reply-To:References:From; b=T1+dwJS6DTfCD01IVo0WWW9SE9eRCBKemDF88zB4FQDmzY4Vdp/w8oFvKaY1GqnBW hUqs64C8+eEP/MmlbFJl3fl21IntBWegsZG1DuWorp41KbAQtMx1fB8soLjncD3Q8r tuAoVtsv1m+5cfjvZ0u5kC/1TkXHDWgzZEHQftiVdY8R+dI47wMmJrCtnTJbGbZz0F n5CQ89HHw59oMKyTex7hGF4Fb3n29U62PsnZm1DWy3secMYJhArDiHIL4/q9yZ/UcS azfz2geLQlmgqJedbsTuSS3ECjBiJ05tbULSBpE4y47NQLI7gLOP3uZHq1YsX9TaSq 5q1RvIklxJdww== Subject: [PATCH 2 09/14] SUNRPC: Remove EXPORT_SYMBOL_GPL for svc_process_bc() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:07 -0500 Message-ID: <170629116747.20612.1033017631209360110.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Reviewed-by: Jeff Layton 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 Fri Jan 26 17:46:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533089 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 342EB20B14 for ; Fri, 26 Jan 2024 17:46:14 +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=1706291175; cv=none; b=Hag3WulBSGHdaPMKpuaIDFOsPIGmE7zP4J1oZ6qpsT7hISgfzSGAl4elYLz0+TICXR/QVdsgfMOFDclQFHBtyIHohMRcsRwqcwFHZUS8WzZj/La8qcZ/2Sx/m/wt6wNFmj18T7Fr1my+9NEePxcuoXhw1Kt+fIfV6msBzZ92tdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291175; c=relaxed/simple; bh=RXbNe9skuunFXd3UqIH/98ek4SEQvNXlbkmtVYUYebU=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TbsWeW84Kd9jUQuK7iE8gQclpWroJHpBUXec7PA7wNSkkV3XxQaD8dBchCbrc+d/9e3v3N/O0d6hNAJFudOcxV8Zsry5EbQGngzgdyXo3kvLawpriVUHwxcuDq7FwRiHr5jxvL7n/wgmcGDGleVU45xU5UO6aFT0Y9wtOqmFOWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d0rInbVQ; 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="d0rInbVQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA1E0C433C7 for ; Fri, 26 Jan 2024 17:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291174; bh=RXbNe9skuunFXd3UqIH/98ek4SEQvNXlbkmtVYUYebU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=d0rInbVQC5AhCVQPp2JecAVQ6Ud1Nr20lBKzuY1UMywDbgPb870w8waWV1UeKfj07 5/+wNX8FZn5m/AAUCM4PS7uvARsfOEawraIWWJISdISyDJFLAY2XOdORVfy/Csarhi 9OQMN4+i8/Ol9+x0vf727U0O5WDEMihXQmQaewJHB1ksXY5qvs8kZhIKyxLgqTPHWp x83Tvb39GzJvaYzOm4jO+f9DYFVT/CBZxR4xRBQ9tLsLDw9qKjJhYXTacoGCs9QmEb HjrBE1Kgh7zKT2WbOvgzWm1zJjnXD7B/HYCiJmmYdzTVBK8hXntbGdgKRJT+dIjSnh k9xqZwG+P4bQQ== Subject: [PATCH 2 10/14] NFSD: Remove unused @reason argument From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:13 -0500 Message-ID: <170629117377.20612.8085088131947006673.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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 Reviewed-by: Jeff Layton 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 b50ce54aa1bf..45a31f051595 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 @@ -1012,14 +1012,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; @@ -1031,7 +1031,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); } @@ -1183,7 +1183,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: @@ -1195,7 +1195,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: @@ -1214,7 +1214,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); @@ -1260,7 +1260,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: @@ -1382,7 +1382,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 Fri Jan 26 17:46:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533090 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 4CD5D20303 for ; Fri, 26 Jan 2024 17:46:21 +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=1706291181; cv=none; b=hL60GCg0ZYZZMZD1G9MWrrLy3QmCMQzfXwLCAy+PbBmwUQBuElE8F8JUUiyCovXW5LDCKWkpa4nUOSfzVVFAD6yWZF60yxwJjA1XKHNn6AuQqmrhHXhzJKEtxNdvZhhz0f4GEvapelZ1kd8K7vPSIaYqE8yUTGrn8Ek7SPVIO0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291181; c=relaxed/simple; bh=w5Ztfv03oez4zsZd54ZBZfikfZeBIRvATmbZjwYSxYE=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mOUEZxatQ/eGIMdEhIldOgQFTUje9Usz0lUa3CDdvu9XIqH8UII6py9NGRrk+Y4L5TA+pxreXnCxfhctdkQ8OTYjadmptas2r9ilEWHvxKjnC6Q7M62g14bRJFAoPNTb4hk3rRuVVh7IMss3Kfklenn62+cI8TQQHzMVpD6mPw4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uPMQ9w+g; 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="uPMQ9w+g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0817AC433C7 for ; Fri, 26 Jan 2024 17:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291181; bh=w5Ztfv03oez4zsZd54ZBZfikfZeBIRvATmbZjwYSxYE=; h=Subject:From:To:Date:In-Reply-To:References:From; b=uPMQ9w+ghPK4tiQwSrByfPPFfXRIhaQ3wmIAgE3HUeRhXktHnScQJt7UKEnio0Mnl 4CW0e8jGpHDUhI2K3DMdlHY7WyD+QF0mCe6f+wix4QMerNjlZLn5XZ6ye++p169EvC HHy+MJ+scx+MKUfjJ/zGxtHKxkQqZde6QNyIIuGUfte/UwNsAAR7DTBucwJx75H5K2 nkhgaMje5rvujOWpYcjuAngUFpUZOCAcx63A6k06X/pPOknm2QXNLVF0lhy2g8E5+0 MJeEDOLKM6tKsjQoLItxUPvC0JsPPVt+xe7HRIfrP1XdHCP/lkdQzSkfaSGa0mwfho nkKTChsZJozhA== Subject: [PATCH 2 11/14] NFSD: Replace comment with lockdep assertion From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:20 -0500 Message-ID: <170629118001.20612.7293384112958646908.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Reviewed-by: Jeff Layton 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 45a31f051595..d73c66fa131d 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1315,12 +1315,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 Fri Jan 26 17:46:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533091 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 82F532032C for ; Fri, 26 Jan 2024 17:46:27 +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=1706291187; cv=none; b=Fi8QlP/dwu9oXMssWZIzlA8R49BoHJIAMPCNaCYc46HQZSrCqyq73nGI00TykYZy3DlyYy9JtEOFfdKpPZiY86guVj1q7f0tSeFM6Mis413i5Lrl58OQzQ9NQYpJTkgEIVG//ZlgnD1CyuSLoc5Klw0F7ISxZ+N2EY5viO6GHhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291187; c=relaxed/simple; bh=Fu3L82waShOOX7KYol1b4ynHXnaie9En//gVGDy+Hcs=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lwtUu9rcLXCRKKthdx7tXOaByd8McpnnUvpsAWYaXSlVeOnZYV1paFZr9tACLuZQXqdIJuTnoJBuFpycZ+pwoM40tjVNdumuO13Qa4cpXC8msvqF1CbEUYZQUb+nHxcdaaJP0fLNe0HAfjfMLOO6Czk2aGmptKS4NDMNgoJb2kE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fmp/DpPr; 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="Fmp/DpPr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4244EC433F1 for ; Fri, 26 Jan 2024 17:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291187; bh=Fu3L82waShOOX7KYol1b4ynHXnaie9En//gVGDy+Hcs=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Fmp/DpPruUpdUUP6sqYUMDQHYisNVaXgukAln3+vSL41eMN/webwP6s2HDlVt9dBd LuY6AmkFv8mqOEl5SF7vGcWKOwA4T+jaoL+nh2ln4GNE5sZmAiqqgT0F6ds9+Vhlqq iigGSmfNirGldA8zaC8zCzuihH0XurArHMvNxkZ9zum/CdOCYkPoPvCesuL2zOcH/S pVvRZ9ZWaSpfBxeuQbcq8dKBQzU7+oANWi6xako6o14v2Hce6xBHyalnqDdZlu6ydk RjfZjVbBAcXh9pUgpLdroEJ9C0rHVh31ZyuWyE15RNmC4Eywq7lYrjApBQNaD8JdRj Fp48Hub1wQHdw== Subject: [PATCH 2 12/14] NFSD: Remove BUG_ON in nfsd4_process_cb_update() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:26 -0500 Message-ID: <170629118633.20612.16185729156649168754.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Reviewed-by: Jeff Layton 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 d73c66fa131d..fd6a27e20f65 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1370,8 +1370,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 Fri Jan 26 17:46:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533092 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 3C3A520B22 for ; Fri, 26 Jan 2024 17:46:33 +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=1706291194; cv=none; b=hyHUpJCizRaluDSUauf4E5aQoBX5pLY6TD0TiKF+nhsDzMwCTTLA6LvOiqzB/1rA38p5FiCS6skfBPDuLg4f2wm1fOteUkuhJbNEA4+F29RN2cVH+D1TdcU4CNEAQEF9OHYxr4wmwxmwzi2W0OrbZOIaknnbVVSRVdzRTXaVOos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291194; c=relaxed/simple; bh=HIVpvEqymtFGgMm79OZU2Ksf1cHno1/l6P8SITVsXEM=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qFfPhb+71XglqTL7CriIR3QTPcDMR8FhOCN+Jx7Qf80SKs9HNpz0409b3FmkId6jLP1+UoAPmB1MhutrAqxksf2Gkj7Eg8ubD6ydt/wvLkkseFRpYWq4GZnBG8KGXicIDecik1gUvSOEyO9dI5CUeRjiFfZXW5uxl7373rCSkkc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Kc/YrBpz; 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="Kc/YrBpz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DB16C433F1 for ; Fri, 26 Jan 2024 17:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291193; bh=HIVpvEqymtFGgMm79OZU2Ksf1cHno1/l6P8SITVsXEM=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Kc/YrBpzGckh41fqCgpPqxdU43+MXVwsf/PSpxUjeyFXxk/XTs9CbeZv1lMEHspdc uqlf/S3B5GcXXvtU3+RUdkZ9zaxCHXWWL6l5JET3vYJ/y21nIKj3xN2qZB4xln25Df ilIXLlucIVm15LE3QtUmYYQD29IRNbwJ5cHXAUMYsT73uzMrCJBnxaedm9UWmzUynS ZudjGD/+5Ul0bahBTHmuc/SH5DC0FkK5CSBS7YoPqc7rLOrguOijvTLr/0u19C5Gp7 yrMe5k4K81o/Wi37PZXuzXsHGjaJlVHcUDaoPO+MdLxsDz3JNiJlY5kiN3B7r0i8Lo s1nxlmzaiJ1eg== Subject: [PATCH 2 13/14] SUNRPC: Remove stale comments From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:32 -0500 Message-ID: <170629119257.20612.7741739631969908034.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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. Reviewed-by: Jeff Layton 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 Fri Jan 26 17:46:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13533093 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 373F72032C for ; Fri, 26 Jan 2024 17:46:39 +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=1706291200; cv=none; b=urXS2NZJY035mLNUMHD+MW8q9Mi56z7jUJ6njV6I5AawK1NhmA5z5/Z32KaDD/BVm7oz5MU+VjdKaM5SN+n/egTnzTnHCKuQxXQukpII8LYiAFqaGKVU80+mrjMuqb7/TtOHfpxRrc9EHGFKhETzUls/dULWjbIFKS/tiEoUAaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706291200; c=relaxed/simple; bh=1RoeyvJ3fqgbcOrczXHuZjt37m81BwC+5hWnCxC9mts=; h=Subject:From:To:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l+vW05WC47xQHEtXYye+5fsGqAoeTjonVHRZUlnSTQ/9Fa2ZuKr/h4Zu2XGQSFL1Kgtdhfn9bgoO0Yf4keeuyQgvDxB39d/6mJkLDOVYPI40a+rnlb6AJ1Yenojyr3HyJu+snYKwUNn9sL1duMQfs4d8JXtxHWQWTeqe0dnjYfI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k+A3j3s7; 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="k+A3j3s7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC3A7C433F1 for ; Fri, 26 Jan 2024 17:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706291199; bh=1RoeyvJ3fqgbcOrczXHuZjt37m81BwC+5hWnCxC9mts=; h=Subject:From:To:Date:In-Reply-To:References:From; b=k+A3j3s7dJKoTEYdCxVTtltq7oLnha3XqEkoX6IHWe5I1PoXKzGbcsZK0SYmRSO+K GaGnEJA0zjmdICiTajptWcBu+KdaF3eUL44pi0RlzE6l9InBXiOBz59QsB8ePCKbI5 Wo9+6Rli3mp2TYCcPn5s+8NcrpYCdNdhZF6+YnYPBIAXbDK28Kb6tdKB8B+n+kM9q7 AbNuPBQ6VmmXXdqFmq9rOP7LKcJBVqgnU5GxvjPBtCKKVvYYxMnOSLbelkrMec7l38 qxIgUTt+AvK4W2yVBs1y3NgBvSx8Vy+1cwKWFN9HHIXnJPedSh9dKXImhapsA25Sk7 zrGkEw+A/AaOg== Subject: [PATCH 2 14/14] NFSD: Remove redundant cb_seq_status initialization From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 26 Jan 2024 12:46:38 -0500 Message-ID: <170629119882.20612.2851346207930593641.stgit@manet.1015granger.net> In-Reply-To: <170629091560.20612.563908774748586696.stgit@manet.1015granger.net> References: <170629091560.20612.563908774748586696.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(). Reviewed-by: Jeff Layton 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 fd6a27e20f65..32dd2fbb1f30 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1450,7 +1450,6 @@ void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, cb->cb_msg.rpc_resp = cb; cb->cb_ops = ops; INIT_DELAYED_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;