From patchwork Fri Oct 18 18:44:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13842227 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 7DEE820494E; Fri, 18 Oct 2024 18:45:20 +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=1729277120; cv=none; b=tB+5FkQt+TlEE1nGeYeQNA3EFijizFU88ufrPn/KqlvQSalkQcRxBaLoUKBOuuIvDAjcV1TN8dD2BMGhbc+QxWZ5X7OCwTLX/YfrdEb/CqQ5NXhZYCCS3O7Y2ROaalA/+K3ONqSOX0IVy+jkCMBWbIw41RIwVN95lcysmypiLTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729277120; c=relaxed/simple; bh=9dORPtUtvLZEQpvgCknFm5lI/gMVvJs3Bu66rz+dJmg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FPGa2kxB+TbaWtnBBRCjQj0IHACHGDDFBkCmj4EesnNuQQhvlyDeoLdVDZc5W77Ge+22P5IFis6ivXP9gI6vO4F7nlkwk4Utzug0D/Jqwn+PZR9DjiWgFLM1C1awtSv1Tg7CpoYBSeTIO2uZw81Jr1TKM5eiGHzHR77ggTWRHB0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sjrU2o7O; 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="sjrU2o7O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A83CC4CED0; Fri, 18 Oct 2024 18:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729277120; bh=9dORPtUtvLZEQpvgCknFm5lI/gMVvJs3Bu66rz+dJmg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sjrU2o7O5Tgw7bOHy+u6O/KvAosToH4RlNvUZJjsexDgw4IFvRYbLl9XKFux5lZOF XZYGImtlJYeP3FPyc4htF8BlI913scEQPOD5wGR1wB40AqqlHFexfcXDxQUao3qJNC /bqscCEpKh2PeeRdUUP+SETQiVMeYZM2v8biVhuQBYCIXlqFMUbF2IgVevAsCQox5R TFcCSDE49WhYbkSdQT5mJP/KN/wLBBd12C9se2GRJCN9VUdJuKbgZEUNbV+hp/Vpot 3Ot8svQ2lH4Us8s/y3Ix/0zCJuOapCejRjpzg8sMZ+f5lYOtL2424eS7T0sJwq5PyE d/Bxiel00/Kug== From: Jeff Layton Date: Fri, 18 Oct 2024 14:44:59 -0400 Subject: [PATCH 1/3] nfsd: add TIME_DELEG_ACCESS and TIME_DELEG_MODIFY to writeable attrs Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241018-delstid-v1-1-c6021b75ff3e@kernel.org> References: <20241018-delstid-v1-0-c6021b75ff3e@kernel.org> In-Reply-To: <20241018-delstid-v1-0-c6021b75ff3e@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton , Olga Kornievskaia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1056; i=jlayton@kernel.org; h=from:subject:message-id; bh=9dORPtUtvLZEQpvgCknFm5lI/gMVvJs3Bu66rz+dJmg=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnEqy9sP0b+nozNRoGiEdQ9EHtl/iKXSoEL4IYX FShsRGRqMeJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZxKsvQAKCRAADmhBGVaC FQRYEACr5zpAx4abfOz5v+lVRUrUNumFnZHudNuu4AQ8dD068t48UJYQEWBCGzXLxacJObArR62 7qdAG3dJkG4X41SdcRMtTt4qcWXi8MNsvj9LonqFxmJ/r+z0Y5hc9Hl2m/28GyZH1w/xshfjEs9 XvpttS/5A1v3dXrRLovOhfD86RNGaZ8bd7ehh6hhL8m3A//YuI0exiXiF9+TCCeBwB0cmPsauBF IGJlNZJuKiZgmmhx+vruycBLtqSZ/j163OEbpGL70TTCJ491wrPSq7X8eQx6Vdjhhid92R3r8mF gKkYLDXHWbQ2gLct7YdnOnkfPuWX/8MgrIV6IYZpedPjolWkwF3qt6b5j4kuPSvCqdt/wiIQ55R ZRDX2YBWDeL7Y477qIwSOPBP2yGbWTNy7fJPEXDRgwTgfALxqIRmOELiM9ZjJoWKGIVEJvp/Xev dPpQ9o8g6R2KQheYaDjOHDEnAdzygzgDfTnQxIZqGq7YsEmhKE4i+IxcwlTQy/ipdPeipfy5wn6 2p87MIGMbj+XpQ+45zOPxZmjbp2Gng0bSLVKB0KqV+zqA0msq3KL62zIP+5MJQ8g8TRIh6ZS4Z8 fkOmoIB3ZZZspWK/hIg/k3TTkuS7/XrSsoC51l93Ei5rx8L0d9kfrZ6IEB/UlL+mf8C4vUYFCsc 6Htt58lplLvq0sQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Add FATTR4_WORD2_TIME_DELEG_ACCESS and FATTR4_WORD2_TIME_DELEG_MODIFY to NFSD_WRITEABLE_ATTRS_WORD2 mask, so that they are settable via SETATTR. Reported-by: Olga Kornievskaia Closes: https://lore.kernel.org/linux-nfs/CAN-5tyF4=JC4gmFvb2tF-k+15=gzB7-gkW6mHuaA_8Gzr4dSrA@mail.gmail.com/ Signed-off-by: Jeff Layton --- fs/nfsd/nfsd.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 004415651295891b3440f52a4c986e3a668a48cb..f007699aa397fe39042d80ccd568db4654d19dd5 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -531,7 +531,10 @@ static inline bool nfsd_attrs_supported(u32 minorversion, const u32 *bmval) #endif #define NFSD_WRITEABLE_ATTRS_WORD2 \ (FATTR4_WORD2_MODE_UMASK \ - | MAYBE_FATTR4_WORD2_SECURITY_LABEL) + | MAYBE_FATTR4_WORD2_SECURITY_LABEL \ + | FATTR4_WORD2_TIME_DELEG_ACCESS \ + | FATTR4_WORD2_TIME_DELEG_MODIFY \ + ) #define NFSD_SUPPATTR_EXCLCREAT_WORD0 \ NFSD_WRITEABLE_ATTRS_WORD0 From patchwork Fri Oct 18 18:45:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13842228 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 2A202204F7E; Fri, 18 Oct 2024 18:45: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=1729277121; cv=none; b=OMUccTBLOLlU93QHnzhBfySR43DQoXnUojvngyvTr9welquZTac4XkTPTw6JETiwfFDZhda1iMtuKQcgzgcDCe7gnmmO92Sm2LSRGXdhzPKWk6Z1efateZ4Bl4//oqMFzmFThU/3KCdcZUZu02Th0yrdBVGaO0Sw5d4C00M36Xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729277121; c=relaxed/simple; bh=nqOHeFQ2YRLvNuQnzNCeXfKbiKvT2jPMl5MlLaketm0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DECpvfBU3W4De5MY2z57WJ29mwvC52sfy1NRq7URMhDhzRGWEo0iRE/WNIrrGBPokK2j1RqWGYvQGXb4awl/yEAAqaxmvCa6kOPfDJjajc1B0hRNE9W4BbnfFVhlc1hv2RG2I3cb8kV4Hls+zggziTAajm3wvFbIhuITlYgw9Hg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cdt0v5Wu; 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="cdt0v5Wu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F85CC4CEC5; Fri, 18 Oct 2024 18:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729277121; bh=nqOHeFQ2YRLvNuQnzNCeXfKbiKvT2jPMl5MlLaketm0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cdt0v5WuBZwbM92TN4NWGoiptAy941Qrkvr4/PzlCaRsWq17hZTvsRcfT7otJcOTI 940mdN0t8gTB/Wb+5auw8vGE3V9AG0YsTkSyoQaH4vC787/eQrsMXLYOvYLAkKWOZj e5DGEMDwaiXxbbYlq1mLRIIrw/tEMtR1d7GMAxQrxAq1D+lCHX6G0NKuKXVRAaKg5p iDQkNL/MnRoTkINb33edzo+mayws4k0bdLooirSjVDY/vKNnh7Sck18xe4ym9Qts6m EnMNV0qU4SUgmlv8Cx9DWEE+IOFFVUDu3Sjux1kjkbklOH0Ad3P3aSn6TbBFTsOnzR ThcCfu7qTqNiw== From: Jeff Layton Date: Fri, 18 Oct 2024 14:45:00 -0400 Subject: [PATCH 2/3] nfsd: allow SETATTR to provide a READ deleg for updating time_access Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241018-delstid-v1-2-c6021b75ff3e@kernel.org> References: <20241018-delstid-v1-0-c6021b75ff3e@kernel.org> In-Reply-To: <20241018-delstid-v1-0-c6021b75ff3e@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1799; i=jlayton@kernel.org; h=from:subject:message-id; bh=nqOHeFQ2YRLvNuQnzNCeXfKbiKvT2jPMl5MlLaketm0=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnEqy9XQrUlXxAyr+TMhXGfnZmk/eZ9unJoB+zv dVgMg5f8NOJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZxKsvQAKCRAADmhBGVaC FfJGEACqSZFgGLtViE3R9zqaof9Q4EK+c4YwOks0iZUs0cIysdS2sF/4jjuvY/YMoGtCjrsugIP 6WN2J1+eEYhDckZ9tg87m1qhPgvzDRrKHXk4g8VFqUtCJw4LtkiqbNQaxAAs9b9IEwRosR13LHG lpioUIvh/eqey6LCS/dP1LiRBdH6227N95tM6mrKHgyB9U8BOpAr50lBq5VTy9MWIHuQLu5oaCO OF7ufFi6+Cg+Cy0aIHk22xyzWf8Rp4jHZKfg5O/5yXFgJ/HRk4xhNjSPuIX9LB285zPx7KYoGFB T5Qjut+jUGVYa2Buc45ymKq9eS+M9K/C12wL5jc524YVwZKo33opKucABdSgaazD8FFeA/utL9H NrnrQmMFhRoppNFqO7gTgAw2kAz39BffUOoNa6PtVkTRfbI6odk+VZhDjs4ty8XXv6MSVl8PkRY M6j81YQGxE8lU7ZDfwNcynGMQpIChxC7FpuEHPicSeDqNJLsbsRRP1+N3zzlCQZHp6JxBVtwfi9 NNF6yUAgGkSd7NErWHBOHaHuA9GpdgaOVqTr4BJNROaurZc0wbfFRNx5cyXarG9loLAClcYSPJG nIxTfAdKwzQhbZX1AcNpC/cotk/UHmrX3XcODHeImEUyKGYKj+Rjlik27LitrpQqtDx9B0eH9UE pNsoRGGHqjAhU6g== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Currently, we request a WR_STATE stateid for all SETATTR requests. If TIME_DELEG_ACCESS bit is set, set the RD_STATE bit in the mask as well so that we can use either sort of stateid. Also fix nfs4_check_delegmode to check for the absence of RD_STATE instead of the presence of the WR_STATE when testing for a read delegation. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4proc.c | 7 ++++++- fs/nfsd/nfs4state.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 320c4f79662e65848dc824885566d48e696fe97c..f843b56b7b2056cbb69669e50c9ca9797cb91f0f 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1143,9 +1143,14 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, FATTR4_WORD2_TIME_DELEG_MODIFY); if (deleg_attrs || (setattr->sa_iattr.ia_valid & ATTR_SIZE)) { + int flags = WR_STATE; + + if (setattr->sa_bmval[2] & FATTR4_WORD2_TIME_DELEG_ACCESS) + flags |= RD_STATE; + status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, &setattr->sa_stateid, - WR_STATE, NULL, &st); + flags, NULL, &st); if (status) return status; } diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 7905ab9d8bc6820dbb7ecb6f29c1e14b036e0de5..4ec58aab10410471bab25b3780facad4d77441e7 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5444,7 +5444,7 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate, static inline __be32 nfs4_check_delegmode(struct nfs4_delegation *dp, int flags) { - if ((flags & WR_STATE) && deleg_is_read(dp->dl_type)) + if (!(flags & RD_STATE) && deleg_is_read(dp->dl_type)) return nfserr_openmode; else return nfs_ok; From patchwork Fri Oct 18 18:45:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13842229 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 1BB4020A5FE; Fri, 18 Oct 2024 18:45:22 +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=1729277122; cv=none; b=nZw+6bapt5XBJ1B6fX8teqbXDNpeyEdTgJ0gYGujT7e9/Io8OgfqSJ1txs1O3ba7k7lukHMjnoNXhsQaOgjZv6qnPzlDlG5iteX9bnzrUgxagRlPcW5Zj9xyrws3bYYpaIXSXOf6YtW08Q8zY2z8tVvEaqqlj9pg5fMRozXGL70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729277122; c=relaxed/simple; bh=6oJn2aEEoutWeHcGojFh5Y9xnA+CV3CIgh0ADvK8SbI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=osHNrDy3M+5hoMx1JHpNGyMU73gMachgRb0qwOczuqk6X6kteFgmelNvs1cbA+0jjD7kM9NtaY1Q+c9C69BZqjigbt94ND7ZGCy7fVDa6xTfUxtsFdJKylJUEx4nuJWTmAqimthoVUohxpjL12QslY37J/NAoz511YjGNGBtxBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bOjCSpXh; 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="bOjCSpXh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40A20C4CEC3; Fri, 18 Oct 2024 18:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729277121; bh=6oJn2aEEoutWeHcGojFh5Y9xnA+CV3CIgh0ADvK8SbI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bOjCSpXhYZmKceQfrnIjGoY2F7OHIEiarJGRV19YncaYB8VfGfgg7vRFPLTsDYt8p yv1Pat7dzZfCund5EbXbiH6gdxZjd1o98JrvGTVOYYV5CjNDx6mO7H1Y5aV3wzo8PS OQMMPWwOlQET4qoccf/8040BE8XCCYbkUUHe36P5Nn4jpJWEgm4xklyDQ04ThBBNKF 6DxRWjGTvwEKjg6tGu4Zei+WBFEcPUGuWn6dH4Q2dtNz5CsNkcRBl/1Q7R/BBdrs0h SsioKJ0FTclCGJ+PIWQZ8aV6uFGFoFjz5RK4r4B1iMC7LkK0gKCuk7eTX0AAUiQha9 XraJOK58W+0XA== From: Jeff Layton Date: Fri, 18 Oct 2024 14:45:01 -0400 Subject: [PATCH 3/3] nfsd: new tracepoint for after op_func in compound processing Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241018-delstid-v1-3-c6021b75ff3e@kernel.org> References: <20241018-delstid-v1-0-c6021b75ff3e@kernel.org> In-Reply-To: <20241018-delstid-v1-0-c6021b75ff3e@kernel.org> To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1867; i=jlayton@kernel.org; h=from:subject:message-id; bh=6oJn2aEEoutWeHcGojFh5Y9xnA+CV3CIgh0ADvK8SbI=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnEqy9wflP1CQIC7cX6DSGGQc+XzV630kZBJul9 LL84qXi1LOJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZxKsvQAKCRAADmhBGVaC FWKcD/46AUcKyRSKR8Ae0V2xDCSeaR0eJaBzN4y2/39a63tgtR+iSC86Crzmi+L2CRRIL8c2I6r SfdblavHuTVusJ19sX0Xd3/N/dsU5LpK0VZxBySMQyy9DBQa48aB++i1ks6AR3LhPES95GqJ/yb D+LReTiy+1arPoqXX37iHbSSR2mtHwgAKnG8Z0c1TX6q/d2k3+WiO8CMR9NA9qx8C2a+/ebxlFe 0ZNbsXLCjU40K02GCT65ao7ZpYbDez5xAOev/+eDr0yzGievHzX/vk2teKFN+HSWWtUkfNbqyhH HnxvefnrefZP/ttFa59pzREJDDEA9ILe7FuHfepDVcKbiOF54nYPD3FihPRh97u0F7cDBLwvXn8 NhSQd812LSkQpMXUqRKDUe5PlSdSEBU0PY5pHB6Vyk7/HHZDkx1CO5KU+D3t06i4DSAtVtObI4F WoyxMvkMKhkJf3wdM4tZhY8ggycGYRYeXjDG0uO+WPzCtLIY/FAQguvqrivIk+s3YU4NGSHLkDq 2Po3lwRc3lq2tlFHw1Fifw5c8pR7GC9Bu69CuBSl13u5BPPHbUM7oP6PNOOBrsgxFQfnIP9L8ew L0W520o7jVTBQPQrto5FZZsfm+0xEMkQP7NniF//FnrauCTvnDHwh5vryY2GJM5smPi8QjbHf6u +5x33S26H3S2lww== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Turn nfsd_compound_encode_err tracepoint into a class and add a new nfsd_compound_op_err tracepoint. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4proc.c | 1 + fs/nfsd/trace.h | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index f843b56b7b2056cbb69669e50c9ca9797cb91f0f..a7912c53f3ca2ecf3e3ad7a93ff9c44507037595 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -2807,6 +2807,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) if (op->opdesc->op_get_currentstateid) op->opdesc->op_get_currentstateid(cstate, &op->u); op->status = op->opdesc->op_func(rqstp, cstate, &op->u); + trace_nfsd_compound_op_err(rqstp, op->opnum, op->status); /* Only from SEQUENCE */ if (cstate->status == nfserr_replay_cache) { diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 3448e444d4100f8f4ce98189d8f605066aa10f49..f318898cfc31614b5a84a4867e18c2b3a07122c9 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -163,7 +163,7 @@ TRACE_EVENT(nfsd_compound_decode_err, __entry->opnum, __entry->status) ); -TRACE_EVENT(nfsd_compound_encode_err, +DECLARE_EVENT_CLASS(nfsd_compound_err_class, TP_PROTO( const struct svc_rqst *rqstp, u32 opnum, @@ -184,6 +184,18 @@ TRACE_EVENT(nfsd_compound_encode_err, __entry->opnum, __entry->status) ); +#define DEFINE_NFSD_COMPOUND_ERR_EVENT(name) \ +DEFINE_EVENT(nfsd_compound_err_class, nfsd_compound_##name##_err, \ + TP_PROTO( \ + const struct svc_rqst *rqstp, \ + u32 opnum, \ + __be32 status \ + ), \ + TP_ARGS(rqstp, opnum, status)) + +DEFINE_NFSD_COMPOUND_ERR_EVENT(op); +DEFINE_NFSD_COMPOUND_ERR_EVENT(encode); + #define show_fs_file_type(x) \ __print_symbolic(x, \ { S_IFLNK, "LNK" }, \