From patchwork Mon Oct 14 20:50:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13835464 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 DEA221CB330 for ; Mon, 14 Oct 2024 20:50: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=1728939037; cv=none; b=Uk4u6ZAwJfserBkQN7TO/PRD8BLr1SruVwLpevRZ0OaSQP+1S7NadmFvrw2jhUVIbIwh2vru9Zw6PT6UIb8ixRx+eLW6ttHBj0Z7pIT+828gsrhyWdEC/NoR7ZQDONFkJwjHxzpjU1KKY+ZiL0PvgxlW1a4Tld/71+jbzjm2ytM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939037; c=relaxed/simple; bh=olCRQyLo/MrJ+Q/mVqgnaFg57B+do6R2/NzP2wNiKGQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bbbn0AKRa+35DiEY7zF6xPu/8DTiayRg9SNUioSeZDycSOLzOYxZVTNbzZ7R2//edQV3StglThvy7V4WhvMOaB3fWlcP0cBYHKPKUGGwIGPSyddcMJOqGY1BUzUpWq10hG8owfcb1TPx9IUL59jAxNcXnmWoIxGDUucIOBu66YI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RtCnBlLR; 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="RtCnBlLR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BBEAC4CEC6; Mon, 14 Oct 2024 20:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939037; bh=olCRQyLo/MrJ+Q/mVqgnaFg57B+do6R2/NzP2wNiKGQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RtCnBlLR+/JzwKLchfOVUHvei3Br6+OFq8yEi5Sv7bYILy4/M8xjz1EX5TeDsOM4b +Pazo53zTVDye6ERNsF5PGTU4K49q7DyGi7UPgcfW6uCAguYYt+pLpaUvpEmXYJTT9 jFmBzDS2hia7hC3OjdV4N01/CzoPrBwyrxCeDhmsuq5FEtH7WJFZzoWx5GUMTGcZyt 33zTz1B4sXphLBQPkrysQQYXN8T+HIvs9LrygyUYz43aOGuQl1wVLF09nN55q936Zu OkeWBz4PweJTxSrAmbrKcNwHAmJtI13jwGGWc0G/C5aNK2vEY9jWtVN6tlPrjXGFfJ a4BU2WadlfbmA== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:21 -0400 Subject: [PATCH pynfs v2 1/7] WRT18: have it also check the ctime between writes Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-1-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2946; i=jlayton@kernel.org; h=from:subject:message-id; bh=olCRQyLo/MrJ+Q/mVqgnaFg57B+do6R2/NzP2wNiKGQ=; b=kA0DAAgBAA5oQRlWghUByyZiAGcNhBujLJzZb/nfltUG2aYd640VPshBc5HAnD1dlmo7ejSnw YkCMwQAAQgAHRYhBEvA17JEcbKhhOr10wAOaEEZVoIVBQJnDYQbAAoJEAAOaEEZVoIV7UsP/R5e tOKQqZZuEqdkTbltrSs+aFgulbgCXUSzxbJylVyKKNQQwc7BaV5BtWY4Vp7kMzzo4e2zV8VeqIC L+UzmHAbnVo/R7WCRytUh33TUeqYrx6xX2m3xOsUXECLf9/Qda39PTlB3PkNzr07v7KJVDLKOn/ 1Or8hEm3bKHqJSV5eB9utgi3DtQFUfm8/TfV90Ra5oAf7/dqhaYmXcxXpH54SVxprbZ0xv8HZCC ZwZANyNHK5L41lPVjr4VC9+QC1oOYz4S/GJgjvnN7znypz+IzbVlZPhmWKHpuCD9J+cpm7GxSsr 8ksF1BMFJfcN9ocXKeRiBUiQ7D0kk4fBt95GkdCbGkf3DOO8s8bdw04Kwagqq6/aOigU8XH7/lN jQTk8Nc+jn4Raird1TS1lP91t3HtjLOT5Qz7NtqRmVyE1YQnFk6m2XKqiLoxeGI9jTY7AsFZu5T /Tic/VvKFOg/Fffl/C5iq0ykbxEpbpNLr//WS6dY95YCJ7mPSyIKwminZEVmxe9eUi7A4qihlVt OY2iyOK7W/MnpEmpUx5+RqWu1+Cty2Ga177a4msUTCL9zdT5pdXwNwWxxZ4O03afFLuWodWqT8U /iBnf9xyvOU09us/vrdJlPi1jxazf+35DZo3rl47yUmlLAuhjUEdKK5schiclw5v+9k2Bths7WK MISGU X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 On many servers, the ctime doesn't have sufficient granularity to show an apparent change between rapid writes, but some are able to do so. Have the test also check the ctimes here and pass_warn if it doesn't change after every write. Signed-off-by: Jeff Layton --- nfs4.0/servertests/st_write.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py index db1b1e585fdbf7169400ba676dd86b46e6c61750..e635717f76c93fc186521688717e25a377de7207 100644 --- a/nfs4.0/servertests/st_write.py +++ b/nfs4.0/servertests/st_write.py @@ -497,19 +497,27 @@ def testChangeGranularityWrite(t, env): c = env.c1 c.init_connection() fh, stateid = c.create_confirm(t.word()) - ops = c.use_obj(fh) + [c.getattr([FATTR4_CHANGE])] \ - + [op.write(stateid, 0, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] \ - + [op.write(stateid, 10, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] \ - + [op.write(stateid, 20, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] \ - + [op.write(stateid, 30, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] + attrlist = [FATTR4_CHANGE, FATTR4_TIME_METADATA] + ops = c.use_obj(fh) + [c.getattr(attrlist)] \ + + [op.write(stateid, 0, UNSTABLE4, _text)] + [c.getattr(attrlist)] \ + + [op.write(stateid, 10, UNSTABLE4, _text)] + [c.getattr(attrlist)] \ + + [op.write(stateid, 20, UNSTABLE4, _text)] + [c.getattr(attrlist)] \ + + [op.write(stateid, 30, UNSTABLE4, _text)] + [c.getattr(attrlist)] res = c.compound(ops) check(res) - chattr1 = res.resarray[1].obj_attributes - chattr2 = res.resarray[3].obj_attributes - chattr3 = res.resarray[5].obj_attributes - chattr4 = res.resarray[7].obj_attributes + chattr1 = res.resarray[1].obj_attributes[FATTR4_CHANGE] + chattr2 = res.resarray[3].obj_attributes[FATTR4_CHANGE] + chattr3 = res.resarray[5].obj_attributes[FATTR4_CHANGE] + chattr4 = res.resarray[7].obj_attributes[FATTR4_CHANGE] if chattr1 == chattr2 or chattr2 == chattr3 or chattr3 == chattr4: - t.fail("consecutive SETATTR(mode)'s don't all change change attribute") + t.fail("consecutive WRITE's don't change change attribute") + + ctime1 = res.resarray[1].obj_attributes[FATTR4_TIME_METADATA] + ctime2 = res.resarray[3].obj_attributes[FATTR4_TIME_METADATA] + ctime3 = res.resarray[5].obj_attributes[FATTR4_TIME_METADATA] + ctime4 = res.resarray[7].obj_attributes[FATTR4_TIME_METADATA] + if compareTimes(ctime1, ctime2) == 0 or compareTimes(ctime2, ctime3) == 0 or compareTimes(ctime3, ctime4) == 0: + t.pass_warn("consecutive WRITE's don't all change time_metadata") def testStolenStateid(t, env): """WRITE with incorrect permissions and somebody else's stateid From patchwork Mon Oct 14 20:50:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13835465 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 826261CB330 for ; Mon, 14 Oct 2024 20:50: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=1728939038; cv=none; b=RsOIn6s7yz1ET2chxOLk9xGp+WGyDCi059n/kqyuly+cXNMMJg5zmJZ7Nd5oeVD2zUJHo7jj/XqRZRaLaKxUCpwwHsKjUx7qVSsbPobseKRb98wa8AOswMiyeF0NRbpMKBkEHUiKumCRn22DYhy9Dq4FGSF20j0arhf7jxWUbII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939038; c=relaxed/simple; bh=2BXxrWKpMPGnMRHVrSRtF2BcozckmBpLyaogBCC9fIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iD+PG0gKAa6hURlCrrPFXyublwm2uUWffHI7ouA23P9iyzO+XyZ/JZXSzIVsiA/+gLiqxNOg+WFR6rsNTVLoG5mpJXQWWxmMjGpp1Wn9WZO4fm+niHma7M1izqjj6bSmDZhFNqfu0lSW3n9NRNLGKbvx8SotgMp2vUr7tYj7/Hc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XTpj7ZQj; 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="XTpj7ZQj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA0D1C4CEC3; Mon, 14 Oct 2024 20:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939038; bh=2BXxrWKpMPGnMRHVrSRtF2BcozckmBpLyaogBCC9fIQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=XTpj7ZQj5otQwQNjtzah7gPNAkw0UyUfIEBUIW9HAxoeOJdukchlGYJQhxtHskKDK flBtEHU/RO7CYAGtzD7jPWjaUmyTcYn0ZNeMccE24EQo+8b6uxsPUhaH2wehYStkGq 2vs8nVudJXgo90MeTFNI5yrzD08RUAUPO0eIqK/I4oBWESNDa37jBaG+XMq9l26C0k A4FHuMPXeXQjjYu/byg4kk8P6LzdGM07/BUeqIu4KQ9KIPHOZbVGQn5as+U+EDe/lZ RJlUUKjlf4BuWxCfeAS8tZZq6t8bzcgX4TC7YwCd8oeeKCLxf9XgVfueXYlFBnNeQJ BBaySjWgeDgPA== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:22 -0400 Subject: [PATCH pynfs v2 2/7] DELEG2: fix write delegation test to open the file RW Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-2-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=968; i=jlayton@kernel.org; h=from:subject:message-id; bh=2BXxrWKpMPGnMRHVrSRtF2BcozckmBpLyaogBCC9fIQ=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnDYQbSfO9+HyPs+VPFG7F/4TiT0xCdcDrv5bc7 INfHzQ/RgmJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZw2EGwAKCRAADmhBGVaC FQYtEADGv7wH1zg6f87ITi9rBop+iSGph8OrP5ea0cqQIbF5ORb8ftkizp+2nF5QUNX5rJFhaka TDzkfVFNoRPMjdpr6n7MBc6aH787Wly8Wl9tmqSZKr+Z+W8BK7JzydzlODWzBq7TiCxYRWSsWs1 ZIEqPnrB2e6iN5q1Zw54mBAvCE9QVd2cmFONt9sUQonEOzJuPNEI29VhampbXqSzUiayTrecyt5 e1I7qa2n+Rp698cyXk3CwdGSeYdZSW1cv6s++y3UhU7In7Fl/Lh+A4XeKxHTRfcRQpVYNHMyGjM 0C/iLYuDN8Y5FjnswFT7blVgEl6mk+kHqKKfDh5jdcNw8+reo6co7t/tIZHOWW9o9WMfT8UryFR FiHeLypcWyBn43U9GRIVdX5AMkVNZaBoABTQX3JtIR8e0mzY4krmxAIedDUoFDpZHyVxt9fOBOU De814MN1VbQftZMSougpc/M//x72GQ5EGil23eccRlDLQkwLuVqdrxwoYdWTowkYH+gQblJD21E 0dRfoGW2Lvcz8sjXsyQAO4a5GEBPwXXT2p12xOliy8hzeCZNtH1jFoRoYGMuADRlgBYBi4RcVCg OySRhnHtEFSlbwjc7jbpPC6fx9KDEjyKOBDN4eLzznS2XLxx+vSDiVV5IPr1G0zNGbJDQIhRLe6 Bo4fEMsh/jjzKCA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 The Linux NFS server currently will only grant a write delegation on a r/w open, so this test fails to get a delegation there. The test should work just as well with a r/w open. Signed-off-by: Jeff Layton --- nfs4.1/server41tests/st_delegation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py index a25a042578b49d005f4f7ea741e623b44c0a0e2a..80b0da28fbad85429fc1f4c0e759be82b0cc5c08 100644 --- a/nfs4.1/server41tests/st_delegation.py +++ b/nfs4.1/server41tests/st_delegation.py @@ -79,7 +79,7 @@ def testWriteDeleg(t, env): FLAGS: writedelegations deleg CODE: DELEG2 """ - _testDeleg(t, env, OPEN4_SHARE_ACCESS_WRITE, + _testDeleg(t, env, OPEN4_SHARE_ACCESS_READ|OPEN4_SHARE_ACCESS_WRITE, OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG, OPEN4_SHARE_ACCESS_READ) def testAnyDeleg(t, env): From patchwork Mon Oct 14 20:50:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13835466 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 E67FE1D0BA4 for ; Mon, 14 Oct 2024 20:50: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=1728939039; cv=none; b=Nmpeig4GFAUbsFV4aAvo+P6Z2ItAoprcjYEvDg1HauJQKsq7VaAv1dTA+3kxsUpKXIl0Wz7PSeJ4NTW96vrYh6XD/3lNXBJqi5IS9nrnSfenDxcGamkJlzlQwEhvqeP+yhLiuLgFjRH0VyiVPQxN1OcGolBDmxm8+NGjZFr/WEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939039; c=relaxed/simple; bh=vsCQE++9fNtDNhdGuW+pt5FaA1rPidzMAV8yqW4+ndg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mrBjeOaM/BpCfRZSjlgN0lZZtlMKpZVZ9PcrLJnXpFD+9DTqZq0E4P+7FIXxMSTAWO2kdiSaC7//jRF72fYhmLNfIlXrzeLRH/m0yU0DF4iOqnFiy+MBibX+aUfeowQ1ypnI63OdRx+2ZK9m6rDHILW3a/P19K2BTrxLrsncXIo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SUNfklcI; 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="SUNfklcI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 449D8C4CECF; Mon, 14 Oct 2024 20:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939038; bh=vsCQE++9fNtDNhdGuW+pt5FaA1rPidzMAV8yqW4+ndg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SUNfklcIObq/5GhmbzXAeFsRBw/VkjatFQbLMjYEjZs8XWbgiyBVaL/Bga42FZqvo uCoyiuaXZAEWqMYIsT6G0BfQQgGRBLpyWs51wfzykZ14KLMmeP0CJe7NoDfoUI1SdM QU5yO7Bx+2XauvlRmF2NFrT0xUXr5LP/4BbQco+O8m1luQRwntvOr5OecH/+dBettD Q4P1WuRGPoX4QCj1PaWz4mos5b/5tGP24Kw0FhKvBzEVY9pn2nM/krPKfP4xeW7hW8 GFQISOKVjFRCmQqxQkQLLouvmtU6dOB0jo8aAeweDcH4MkuqPzQ+FbA8TKE3hrPaNG d8GkB++AEhdQw== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:23 -0400 Subject: [PATCH pynfs v2 3/7] pynfs: update maintainer info Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-3-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1130; i=jlayton@kernel.org; h=from:subject:message-id; bh=vsCQE++9fNtDNhdGuW+pt5FaA1rPidzMAV8yqW4+ndg=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnDYQbrQ1S4TnpJgMAjWcjEZrkOX07iIidi5TaH Zr9yBjEkZeJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZw2EGwAKCRAADmhBGVaC FT/FD/9i/w4G2Tj9v1XyvH+4S8wjVJ7zHk7EbH9DDoDQH6paXDWiXQkh2IrZSq+XML8oz0V7X1s 9efF3/JWIV93R/JEEqzgC+2JxC80j0yU57pWsdIl8fOeyODz9wB+hmSUuhDACW/vxFFifsTA8lB do2zT/agE+rk6xpkC1Lu3kSEC94M9+0GxjbB9w2Yb6UpZ6HGDz/3gHyrORVOi8Z7aHcTJK8x0n9 FmiN3NsjUeKYJKqTa9wWtHiD59QlCWZfi6R9xhcoVVxt/tRKWe0B7/j3wAz0cTdXI9Wly2Try3C tABTWhvdBAi0QTuI55jNmsPIpkzX8d5bFMZmxt8V3CfSKk0laoiZ6MdLv0NvIZqyT9X0wkk8Kqw 2Fl7m+0Wg3EmEGZveyIitMKhYfdboVuvxrtEIf5QxG+zQ19+i1/kLSfnbLjXLAEKcrKRMujHCRJ KSkg8m6pKHOjItZZRFbAQ/LguodfqAKG5C9JQMC2GAMfX5xV8JXNvRDSPReaOrXFPyYZJ/HQn+f NKz3KQv93P1Ik/asXVa9eeBq0DGyPZyL8X6ZDc3zqs6rUAvHezWaoVjNqTwyAmU8DdtqA/TTnEq wT5EdlHtFYWdm7skE8VH/T9UvN2+jz/dE1mUacD4LNFzeh9m1qVEvz8jwjvmavJN8FDsij6qN/x 2SS4Q8RlDpCadOg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Calum is the new maintainer. Update the CONTRIBUTING doc. Signed-off-by: Jeff Layton --- CONTRIBUTING | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING b/CONTRIBUTING index 220b3e0629aa658e3235ab5d0a7c13e271480cd5..d15b2b8278797b18c91fad740290c9355a5f3d29 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -1,15 +1,15 @@ Check out the latest source code from - git://git.linux-nfs.org/projects/bfields/pynfs.git + git://git.linux-nfs.org/projects/cdmackay/pynfs.git Commit your changes. Please make sure each commit is individually correct and does only one thing. -When you're done, send the resulting patches to bfields@fieldses.org and +When you're done, send the resulting patches to calum.mackay@oracle.com and cc the linux-nfs@vger.kernel.org mailing list, using something like: git format-patch origin.. - git send-email --to="bfields@fieldses.org" \ + git send-email --to="calum.mackay@oracle.com" \ --cc="linux-nfs@vger.kernel.org 0* We generally follow similar processes to the Linux kernel, so From patchwork Mon Oct 14 20:50:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13835467 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 3CF5E1D0E3E for ; Mon, 14 Oct 2024 20:50: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=1728939039; cv=none; b=iglg9xn6XzWm7iWJA0i7x9iikfBzWrJID+1LhCHupQ6IvGcOgbSVZ1QScyxyyeTEiOz8EsDkqcuy7mPonbBA4ug4o4kbw+/7eAciZk7pjMWqG2wmBpiJT6wA1DewFGziyvFUBWAVy7ep8Czvm8UcW7N8hXe9HEEPmhjIvIS9Jp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939039; c=relaxed/simple; bh=1Dt5Lx5cdimQzqLxTgptUSgjFvMCdQ6TBYDG+Mc32V0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L8/zuS6fFlSelipx31691W7zYsNb9JJFsQtRrYWF1BEb8yaeFvT9IO7NoPKKr6CsoN2tMv31w1ou/RBadxypQlSaEb09voRYa++qJA/7xSbh7ia9Vjcyn0QMb0mApbc5N9WVh/p7CPzZK9km7OEJt2vdSLpFNjzm5uSUJtCsnto= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Dq1z3xJC; 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="Dq1z3xJC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3A22C4CEC3; Mon, 14 Oct 2024 20:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939039; bh=1Dt5Lx5cdimQzqLxTgptUSgjFvMCdQ6TBYDG+Mc32V0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Dq1z3xJCzIbvovOCgajsUNaEKGpgv+aVS8xqZkOB4uEB8Gr/OHhEO2DddJhO+kzua tqcBIVJ3lSLJzNX2JMzHogcCmSZ7AklV15NB5hsHUIqNHyUtkGj5++zP0Sl41LnqN4 Ons1MP2rhF52JQ/4WBANOuneiPBut9AYkoeJvhP7d4e+MxYj0JGebYZP64JCMqSYxD /M4PovlTMSWVtpm5K4+rzPLti/MT+fq+PCaFSZE+G5/MX0OIIsIJ89ndIBAeyzlOu0 Fo0WtK+VgsNDUNXolJ8qao+f9Rp09/Za/9c6zBNbX4daa9BaiqNKlW1nbYCsTXJ0gA NJ6q0zNTyQWog== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:24 -0400 Subject: [PATCH pynfs v2 4/7] nfs4.1: add two CB_GETATTR tests Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-4-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5026; i=jlayton@kernel.org; h=from:subject:message-id; bh=1Dt5Lx5cdimQzqLxTgptUSgjFvMCdQ6TBYDG+Mc32V0=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnDYQchHVgugcLwDEaBdKWwu+6CDwDN835UsSbp t5dNZv9TGqJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZw2EHAAKCRAADmhBGVaC Feg2D/0emcfctwfYu9d49iaZwg09QlUFy4zsjpOjtsdyyCI9zp1vamJdRrGXvqegviFC2rPew2e C5YsWLNzfA5SJDQW66jDesLhwW0jYrjI7DBZpgWXwyKJy5eohk6dvXPMYqyDtCMFEdOaseCfUTe GDinG6DZxTHHE/fLWuBaZR58DcSWltdH+MshPs2/dy6giM0yOqp6kOYrJEc97y8nRM0SGQvKrt2 yr90WRKncZRgXpXj7Ct/ermppB7RZB3n6wUM2fUrjtw+x1A0DY5w3RjnXyWOYRIYqBk96hPOyd+ VLbKsNg+IDDpDmDCGUmHE75qefwMZCByDuisCAeq45m4Q9hcLx+erqcLekZAeOEp6aFrqgPYz2D HGpIorIsR+7ooz9xxrzPVO0fyRLoHiGnlkRGli01L+V6nBseaT88F2JxD2XnBAQIOrn1wg0TaUf M77vSB0cHOU47abIRsE75qunIVE2AockjefNjHwZismOFtiuWOdXscvEScy6N5t0PSBrSd9eaZ+ REGPX97w8uYyeZfMTu5wHI0nX/TQ6lpTGKXskmmK2absKHHgyLzbVGqcaTiybI3Wfua1Ooolanw mfGTzpCeE7NnyY8fhLpCpj9oYavOt2fexIQA7wBCfsSyCh9LVGDByB5EqkLT6iPqUtUB28n9cQR q++UPpSMCbdPP1A== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Add tests for CB_GETATTR support. Open a file r/w and request a write delegation. Do a getattr against it to get the current size and change attr. From a second client, issue a GETATTR against the file. One test does this and has the delegation holder send back the same attrs, another has it send back updated ones. Signed-off-by: Jeff Layton --- nfs4.1/nfs4client.py | 6 +++ nfs4.1/server41tests/st_delegation.py | 72 ++++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py index 8ce64dd639c75ea14b24bd5b732ddbe0fcb0fa71..941cf4000a5f0da254cd826a1d41e37f652e7714 100644 --- a/nfs4.1/nfs4client.py +++ b/nfs4.1/nfs4client.py @@ -271,6 +271,12 @@ class NFS4Client(rpc.Client, rpc.Server): res = self.posthook(arg, env, res) return encode_status(NFS4_OK, res) + def op_cb_getattr(self, arg, env): + log_cb.info("In CB_GETATTR") + self.prehook(arg, env) + res = self.posthook(arg, env, res=CB_GETATTR4resok()) + return encode_status(NFS4_OK, res) + def op_cb_recall(self, arg, env): log_cb.info("In CB_RECALL") self.prehook(arg, env) diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py index 80b0da28fbad85429fc1f4c0e759be82b0cc5c08..2aa73ba7acd0bd857a4fd5206b8857f980176d73 100644 --- a/nfs4.1/server41tests/st_delegation.py +++ b/nfs4.1/server41tests/st_delegation.py @@ -2,7 +2,7 @@ from .st_create_session import create_session from .st_open import open_claim4 from xdrdef.nfs4_const import * -from .environment import check, fail, create_file, open_file, close_file +from .environment import check, fail, create_file, open_file, close_file, do_getattrdict from xdrdef.nfs4_type import * import nfs_ops op = nfs_ops.NFS4ops() @@ -289,3 +289,73 @@ def testServerSelfConflict3(t, env): check(res, [NFS4_OK, NFS4ERR_DELAY]) if not completed: fail("delegation break not received") + +def _testCbGetattr(t, env, change=0, size=0): + cb = threading.Event() + cbattrs = {} + def getattr_post_hook(arg, env, res): + res.obj_attributes = cbattrs + env.notify = cb.set + return res + + sess1 = env.c1.new_client_session(b"%s_1" % env.testname(t)) + sess1.client.cb_post_hook(OP_CB_GETATTR, getattr_post_hook) + + fh, deleg = __create_file_with_deleg(sess1, env.testname(t), + OPEN4_SHARE_ACCESS_READ | + OPEN4_SHARE_ACCESS_WRITE | + OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG) + print("__create_file_with_deleg: ", fh, deleg) + attrs1 = do_getattrdict(sess1, fh, [FATTR4_CHANGE, FATTR4_SIZE]) + cbattrs = dict(attrs1) + + if change != 0: + cbattrs[FATTR4_CHANGE] += 1 + if size > 0: + cbattrs[FATTR4_SIZE] = size + + # create a new client session and do a GETATTR + sess2 = env.c1.new_client_session(b"%s_2" % env.testname(t)) + slot = sess2.compound_async([op.putfh(fh), op.getattr(1< X-Patchwork-Id: 13835468 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 B7ED81D12E6 for ; Mon, 14 Oct 2024 20:50: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=1728939039; cv=none; b=NrsVfNepPCNNN7Bk8IPK0zHX/ENTHbVxBAmcDYpRMkm1OdLa4kn0l4cf2SEuXeluX95sucRNUpf25aNSl5bwbBBcu6+N+YSs9MnuVJmHQuuwbxiYMjS8mFAkYdaWl49K6/liFf+rhoyWzmBBtj5VolHpQJXsEyDKy26sUVpfqWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939039; c=relaxed/simple; bh=tuVwvWYjGCe9syHnueguTd0UO7Q1suqSdTrGQi78y0U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QZEt7gcwErSGPLg/3YebvJ9yTlUHQ4G6QTBgF3SrhUcgHpeab9bfeanAsG8+aLc8s+FNCmRVUbccCD8mAeFSDpjlKxQDfo8MnBvubnSdJHkVjk8ZbPqiUwQuVrKf17ruGt7/6bVTQM2y2PHjwoEDEHmQUmtZWLCfyhuzGAl3uvk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BQTh7aVw; 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="BQTh7aVw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F2A4C4CED0; Mon, 14 Oct 2024 20:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939039; bh=tuVwvWYjGCe9syHnueguTd0UO7Q1suqSdTrGQi78y0U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BQTh7aVwzZSTq2Oqob5oP20aYIfSbD69qfeBe25+nu9Pnu5DS4AFbEKRfawwjFJAL uGKMGXMM4BK3Y/lggMlHseAYH34P0mXfs2oAkqWgLln2Bd7hUO12PcNny5FEk093g0 b8stWP0URkBsscEokUwDVlIymbVqEOCkq5KaTgtca63CrNi0ojY/jliAz2OXtwwJIo K/kAfUssh9+5xmYro20WLnl6+zgtFxyKB8R6ibdBdJsS+aXtZSQ6cUrrMndawgnFw3 IjxGYPf1VWB+tTFZvZqqlfKDfC8rKyLDR7FXCGP1aYC36oT16r7Wk/UxgybRHJ//sP F6lKBPQjHyo5A== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:25 -0400 Subject: [PATCH pynfs v2 5/7] nfs4.1: default to minorversion 2 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-5-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1695; i=jlayton@kernel.org; h=from:subject:message-id; bh=tuVwvWYjGCe9syHnueguTd0UO7Q1suqSdTrGQi78y0U=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnDYQcpDip5vbMtewA0dp5wSostjjiqN9k5Q66F /Z42GR6FE6JAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZw2EHAAKCRAADmhBGVaC Fd8uD/9rED/36+nqh5O34rBrLe5EeY8bGG2GhPOpEjDZp9p+hh8W7jZXA+wYJoXQYaIECvKFcgA Oz6S9eMDxFR26B8DRknHgzhg7/EYWzuZlrFIzw0+mu/IhjRTcEjD2PWAiDPTaF4o/gChqgO3BFl oTxkYmFoQNxQfmunmiZhAZ2v90+bDKRSsDLqcRu7J6YY4XVZIdN/KH+FS9yf5ltUJMsLR9ZCYj0 HFB45H32XVdWjPKylY/QpVIjyGMTsVBpBfPi4RBd0tWmYbf65n+pIiBc0+XJgfIRTkxeVJSVzsC WKsV61pTwdpLCXWVfVDM6UapD6QvSNxXEHB+eZW9gb3sp1q9HFHyoAuyEw8GZ4qO/1sp9DAu8pP 9PwhQneCBA7MR4huPD+7bVP3ma3RWghaamPMNobYnsNrFf0LpQUVQ1LLJ6gghpIaPFgvnCNrSJm kUKUok3BrjY3RMj7ZXM+ENoVxP/ddEZ5fJ8aDfYdOB1UWaIm7Gl7kBIQzkopuxQGlPpzcbJIdK4 CC3+IsNqBjcqaLko3wcK2qZLf5FlOpXqEiLQHkkmhCRlMTCAfNOTfKfRyKS7Nmiaw2/d+tjXmpY VTnipv28ABseJDzBGy5GZ12gJwE9/PTakmKDi5fPOCE0yuFceZiVK60ukGuQlo2U1nyft7Km2zz uXynCVnT0MW0vaA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Minorversion 2 consists of all optional features, so we can safely just default to that in pynfs's 4.1 NFS4Client. Signed-off-by: Jeff Layton --- nfs4.1/nfs4client.py | 2 +- nfs4.1/testserver.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py index 941cf4000a5f0da254cd826a1d41e37f652e7714..f4fabcc11be1328f47d6d738f78586b3e8541296 100644 --- a/nfs4.1/nfs4client.py +++ b/nfs4.1/nfs4client.py @@ -27,7 +27,7 @@ op4 = nfs_ops.NFS4ops() SHOW_TRAFFIC = 0 class NFS4Client(rpc.Client, rpc.Server): - def __init__(self, host=b'localhost', port=2049, minorversion=1, ctrl_proc=16, summary=None, secure=False): + def __init__(self, host=b'localhost', port=2049, minorversion=2, ctrl_proc=16, summary=None, secure=False): rpc.Client.__init__(self, 100003, 4) self.prog = 0x40000000 self.versions = [1] # List of supported versions of prog diff --git a/nfs4.1/testserver.py b/nfs4.1/testserver.py index 085f0072388ad8a4b477073641ae16268532bc6a..0970c64efe34dcec1e5457b7025faf0cb139670c 100755 --- a/nfs4.1/testserver.py +++ b/nfs4.1/testserver.py @@ -74,7 +74,7 @@ def scan_options(p): help="Store test results in xml format [%default]") p.add_option("--debug_fail", action="store_true", default=False, help="Force some checks to fail") - p.add_option("--minorversion", type="int", default=1, + p.add_option("--minorversion", type="int", default=2, metavar="MINORVERSION", help="Choose NFSv4 minor version") g = OptionGroup(p, "Security flavor options", From patchwork Mon Oct 14 20:50:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13835469 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 42BE41D1318 for ; Mon, 14 Oct 2024 20:50:40 +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=1728939040; cv=none; b=EBlnDzELSkKPnzbSivAJ7RGTVh2O52Y6Yw2TKybv7ZlHZxJgGOW0scdws2Ok348qa01RvhCsootZWQlirvyDOssG3w0SbAZ7olF3Kf2Wc9gHZoHWGAb6XElxDJ5i8IyVToLa6lkUIbaBsSsAcZplgMHAaZG9vLHc/i9pBjnijX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939040; c=relaxed/simple; bh=HlqGssIt3+GgeWSoa7cHHow5dp3EnztPYYyzAk8xGn8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iGr3HzE6X7FIzPGGjmuS/MeNIg9sPw9TqC+MWEQIPOjZfBwYYKRzBr2J80m2ul2aoWe+6YB+PkET+IGej5tddpa4d6itYzBhzIUHEbyIUYmTrgYUFZKZVY9L6agD8CGsaqWId0At0cgLuSooO3AynylvD13JEyj0fUopsg1TsEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i1HEQULa; 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="i1HEQULa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2642C4CEC6; Mon, 14 Oct 2024 20:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939040; bh=HlqGssIt3+GgeWSoa7cHHow5dp3EnztPYYyzAk8xGn8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i1HEQULald2ITG7AgFlS84W98rCobBp7W92B4CX7aGhKxn8cjxcdgLVpullrASHrK 8n3aFPK5I6YC4a7zluh5bgPHSoA3mNqlY3l8dIqu3zZllHyuZUHUcHbgchY2Whf1gB vQtrsLbUvJg1RtCZYPcOywWHNdxgkvUcpP2O0TjpFYZl5iEHK3kdBXwK/1uJk8F5I/ MPqhIueOy6Vyj+UdPGRj1LhJ/Dr5AHqkmO0pfYNd4lX8R2tibeyG61jhFVzzB8alKZ Cnov8RaRKEW//5tvaaUGV7zCT1wcEzf03iJp4mzzaCxuXA7dzidfvjI7a/aN/jMwN6 sx3oerthUGv8A== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:26 -0400 Subject: [PATCH pynfs v2 6/7] nfs4.1: add support for the "delstid" draft Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-6-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5797; i=jlayton@kernel.org; h=from:subject:message-id; bh=HlqGssIt3+GgeWSoa7cHHow5dp3EnztPYYyzAk8xGn8=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnDYQcmtS2LOmczu4cDPr2Eik+vMqEhswMFHpGy /vX+nyaQ1mJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZw2EHAAKCRAADmhBGVaC FX+gEACg0v2ntGPhF0CXxhn11bs5dniHJyURKe9a+YyErwD2gj44hlpSMPhfxKT4WKfqWQQ8Ac5 6dV2Ic0lyCrveO7OC01i4+k+32ygeWrK7ee15wUBknbgUOMbLdqiI3bqIZwvmhCwGcKiZPnnWY9 gM3rQgEjjIOX1EkfAA3nNRxEuGTt9AcrKOcubZtrkaktKuat9AWpjprTJFU2BiKFtM01PNLER7v yOhspimgN2asgP1SKUoj9kdv4lYcYC2OX2ZsicvzOnF6aQtRhZPvT5uCOOHcoVv3MUoKduKroO6 jRuT0XtIl69sHHAkOjRwp//HMChxncDpK454SC43v9hEdVr2vIXl9o7C2GW510PkU5Z/0ylToZX F/OQ0rVDStSvO1aL6l2SgVDLuZN9QFqCoDOnz+YqXmxu7SSM7BYzwXY2WJgxg0qwpFqDik4YY3d 7YB1qTAJRV2X3dUNjhC1lWRj5Uypq1Wr5QVxuPZgpH80Yvbtg+6PKXzTDCNdq2tkuYO5+aFK6Ec l5lF01uhDlqHRBgO7yh8fHzMK5zYK1Xv0ijCBYF5rRIJXTrl3GEX0yLcBoHqf0DoFXGYUXIiqcz A0jt3n1pyF551p+E+Q6Ve8uhqBu3ds9OpfT8InlI7PKJPSQFBou2LPeJNBa45biYHU1lDCsJOoC mKgCMZzZfWzloGg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Add the new .x snippet to nfs4.x, and the necessary info about the new attributes. Signed-off-by: Jeff Layton --- nfs4.1/nfs4lib.py | 3 + nfs4.1/server41tests/environment.py | 3 + nfs4.1/xdrdef/nfs4.x | 111 ++++++++++++++++++++++++++++++++++-- 3 files changed, 113 insertions(+), 4 deletions(-) diff --git a/nfs4.1/nfs4lib.py b/nfs4.1/nfs4lib.py index b1a247b02f66a529da7f2bd98ec436f168b30873..d3a1550f1ce1e135b124a59fa1518c9ff89fd502 100644 --- a/nfs4.1/nfs4lib.py +++ b/nfs4.1/nfs4lib.py @@ -731,5 +731,8 @@ attr_info = { FATTR4_SUPPORTED_ATTRS : A("r", "fs"), FATTR4_MODE_SET_MASKED : A("w", "obj"), FATTR4_FS_CHARSET_CAP : A("r", "fs"), FATTR4_XATTR_SUPPORT : A("r", "obj"), + FATTR4_TIME_DELEG_ACCESS : A("w", "obj"), + FATTR4_TIME_DELEG_MODIFY : A("w", "obj"), + FATTR4_OPEN_ARGUMENTS : A("r", "fs"), } del A diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py index 0b7c976d8582a0e4ef5bd1d21ce34247f26899e4..48284e029634fff60b7690e058cd4131bfea9b08 100644 --- a/nfs4.1/server41tests/environment.py +++ b/nfs4.1/server41tests/environment.py @@ -108,6 +108,9 @@ class Environment(testmod.Environment): AttrInfo('time_modify_set', 'w', settime4(0)), AttrInfo('mounted_on_fileid', 'r', 0), AttrInfo('xattr_support', 'r', False), + AttrInfo('time_deleg_access', 'r', nfstime4(0, 0)), + AttrInfo('time_deleg_modify', 'r', nfstime4(0, 0)), + AttrInfo('open_arguments', 'r', open_arguments4()), ] home = property(lambda s: use_obj(s.opts.home)) diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x index 7b4e755369d749c2570a624895c234b1454df0cb..ee3da8aa7a342e4d3829f4b1b1f82543275199c5 100644 --- a/nfs4.1/xdrdef/nfs4.x +++ b/nfs4.1/xdrdef/nfs4.x @@ -1742,10 +1742,12 @@ const = 0x20000; enum open_delegation_type4 { - OPEN_DELEGATE_NONE = 0, - OPEN_DELEGATE_READ = 1, - OPEN_DELEGATE_WRITE = 2, - OPEN_DELEGATE_NONE_EXT = 3 /* new to v4.1 */ + OPEN_DELEGATE_NONE = 0, + OPEN_DELEGATE_READ = 1, + OPEN_DELEGATE_WRITE = 2, + OPEN_DELEGATE_NONE_EXT = 3, /* new to v4.1 */ + OPEN_DELEGATE_READ_ATTRS_DELEG = 4, + OPEN_DELEGATE_WRITE_ATTRS_DELEG = 5 }; enum open_claim_type4 { @@ -1921,8 +1923,10 @@ switch (open_delegation_type4 delegation_type) { case OPEN_DELEGATE_NONE: void; case OPEN_DELEGATE_READ: + case OPEN_DELEGATE_READ_ATTRS_DELEG: open_read_delegation4 read; case OPEN_DELEGATE_WRITE: + case OPEN_DELEGATE_WRITE_ATTRS_DELEG: open_write_delegation4 write; case OPEN_DELEGATE_NONE_EXT: /* new to v4.1 */ open_none_delegation4 od_whynone; @@ -3949,3 +3953,102 @@ program NFS4_CALLBACK { CB_COMPOUND(CB_COMPOUND4args) = 1; } = 1; } = 0x40000000; + +/* + * The following content was extracted from draft-ietf-nfsv4-delstid + */ + +typedef bool fattr4_offline; + + +const FATTR4_OFFLINE = 83; + + +struct open_arguments4 { + bitmap4 oa_share_access; + bitmap4 oa_share_deny; + bitmap4 oa_share_access_want; + bitmap4 oa_open_claim; + bitmap4 oa_create_mode; +}; + + +enum open_args_share_access4 { + OPEN_ARGS_SHARE_ACCESS_READ = 1, + OPEN_ARGS_SHARE_ACCESS_WRITE = 2, + OPEN_ARGS_SHARE_ACCESS_BOTH = 3 +}; + + +enum open_args_share_deny4 { + OPEN_ARGS_SHARE_DENY_NONE = 0, + OPEN_ARGS_SHARE_DENY_READ = 1, + OPEN_ARGS_SHARE_DENY_WRITE = 2, + OPEN_ARGS_SHARE_DENY_BOTH = 3 +}; + + +enum open_args_share_access_want4 { + OPEN_ARGS_SHARE_ACCESS_WANT_ANY_DELEG = 3, + OPEN_ARGS_SHARE_ACCESS_WANT_NO_DELEG = 4, + OPEN_ARGS_SHARE_ACCESS_WANT_CANCEL = 5, + OPEN_ARGS_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL + = 17, + OPEN_ARGS_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED + = 18, + OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 20, + OPEN_ARGS_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 21 +}; + + +enum open_args_open_claim4 { + OPEN_ARGS_OPEN_CLAIM_NULL = 0, + OPEN_ARGS_OPEN_CLAIM_PREVIOUS = 1, + OPEN_ARGS_OPEN_CLAIM_DELEGATE_CUR = 2, + OPEN_ARGS_OPEN_CLAIM_DELEGATE_PREV = 3, + OPEN_ARGS_OPEN_CLAIM_FH = 4, + OPEN_ARGS_OPEN_CLAIM_DELEG_CUR_FH = 5, + OPEN_ARGS_OPEN_CLAIM_DELEG_PREV_FH = 6 +}; + + +enum open_args_createmode4 { + OPEN_ARGS_CREATEMODE_UNCHECKED4 = 0, + OPEN_ARGS_CREATE_MODE_GUARDED = 1, + OPEN_ARGS_CREATEMODE_EXCLUSIVE4 = 2, + OPEN_ARGS_CREATE_MODE_EXCLUSIVE4_1 = 3 +}; + + +typedef open_arguments4 fattr4_open_arguments; + + +%/* +% * Determine what OPEN supports. +% */ +const FATTR4_OPEN_ARGUMENTS = 86; + + +const OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000; + + +const OPEN4_RESULT_NO_OPEN_STATEID = 0x00000010; + + +/* + * attributes for the delegation times being + * cached and served by the "client" + */ +typedef nfstime4 fattr4_time_deleg_access; +typedef nfstime4 fattr4_time_deleg_modify; + + +%/* +% * New RECOMMENDED Attribute for +% * delegation caching of times +% */ +const FATTR4_TIME_DELEG_ACCESS = 84; +const FATTR4_TIME_DELEG_MODIFY = 85; + + +const OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 0x100000; From patchwork Mon Oct 14 20:50:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13835470 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 2A5401D1318 for ; Mon, 14 Oct 2024 20:50:40 +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=1728939041; cv=none; b=NRrtvSeKCFBu7xRYCZlkXyyT28XDeQxrmABpTrzG8WWflYrymJ5+mnmXsbKG1KkdMm9slQa5G5a+3uq8aRfZyQcyO+zODqTGvjEFVgvMruvEjXtkn0CZg3Lbb45RfLaieLCOW8kH7F4UfyQaYsjhHWuDP/qUqnuL4r5g7T9Ur7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728939041; c=relaxed/simple; bh=DcBIxLUMKz9pCB7+oirBDOJg6h1EsTbBogYnuIqyvbo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pDL62NyR90OpIP2PO5EgOUl1GeCllO3Y6QUXoHLkiN3hfhCKGAUC688EBOXo4XdUz8q5DNLQaAvwn6kb/3oMvyXWi86a0eB/pmGosBtugqXlgUV0jdWeFdlbitFjGBoyyPPq3STrXRWnXY71dr2549EkyWfhgZc4WDJT/sQruaE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c0ngvPFE; 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="c0ngvPFE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DCEFC4CECF; Mon, 14 Oct 2024 20:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728939040; bh=DcBIxLUMKz9pCB7+oirBDOJg6h1EsTbBogYnuIqyvbo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=c0ngvPFEmi81Y+4b/0q4drveD1yETVVeOZV90pJ1MhQE9YVY8a5MZSGoRKGgbBe5z wNQM2oBK3qPTWfXiGLP6ReNodvWYBuLMwyyFkGMha2hJvy3X1+lLVqsC6rFEjnsXNB 7I1pJnEFJd9uqCb5lHXMWQiKcy4NbPoHIeuYvDN/hmozNaiei5y8EmWVypSt6Sdpcw Kw3bf80bGDgE5RPVQflDB++Q/PwKK17RN0u3FkQf8wfZPlnBQBrrUTeY6noXSB8yGo 8lQw42Z2mynvopgkjpzOmJgHpBJ92ExqdmatKDEbMNiLsT7VHfi5iNEngiSkyr/wVD of8mudK1jPUTQ== From: Jeff Layton Date: Mon, 14 Oct 2024 16:50:27 -0400 Subject: [PATCH pynfs v2 7/7] st_deleg: test delegated timestamps in CB_GETATTR Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241014-cb_getattr-v2-7-3782e0d7c598@kernel.org> References: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4470; i=jlayton@kernel.org; h=from:subject:message-id; bh=DcBIxLUMKz9pCB7+oirBDOJg6h1EsTbBogYnuIqyvbo=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBnDYQcr/qCuMdmN/7/J0FYHj5ZUweI2i0uyf5D7 WYi7OIPS4OJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZw2EHAAKCRAADmhBGVaC FXLiEACNN+XYwYNIxm009s2yKHZHkJi95e3pVTweMMRl6dxsNMxlkKaRfqyBpx4Qmx8NriUX54o 1O0gPO4iByQjJQDFWy/oCibGaToX//YdOSo6bwAZ2Y2Pa1np5ExXA7y3P4LotmrLiiy/PWfeGUF 8LY4m9eAC0CvruJdZaTLhqB8ZfWN8hJ66F9puibflyT2QQa2iJ5yeVIuKvFdddDsMFubyqkdnvQ 3lI1pTsOGmzF9ZFrVm4IEYIBX6uhw3OJATfBStF0kSazaGPAsIrKzIVvqKP9acZn4pMHm2sj9B0 pzaJDVtwIl1Aq5GnAMrO+ISbJfJsw5S9+KXEmBQGaA1aRyztJRN31OGizZrIegI98/0MqoMsSCX Zn9dePJ+Cvso8hEfQ+ksWVE5uMyxN5Npz7EuCm2r0QHjJdZXEG4X/CREqbyS4gklfD3YH26Dicp UeiEzrreB1ajKYEAZCGF5Z4LWRl7zCn2TiRkH0uPzsEukMeFU2xr807aIhcwehNTk5p8oCS3tiI kgV1d3Hk3eKS//OTeAVXqA4X1Qus0lKxsj+dy2RBz/9v0Tr2+aJkLPvW8OiOOFyNISZoJk93sdr Ndsjg5rMXG8ctLu4yf2tA0SZnFuAscee82DC4s5f/O9CADKHhfm0zL0XDP1OvYDPEatl/l0wCPd +neeVEPR2AsoHlA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 First, query the server to get the SUPPORTED_ATTRS and OPEN_ARGUMENTS, and determine whether delegated timestamps are supported. If they are, request them, and test whether they are as expected. Signed-off-by: Jeff Layton --- nfs4.1/server41tests/st_delegation.py | 42 +++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py index 2aa73ba7acd0bd857a4fd5206b8857f980176d73..fc374e693cb4b9a9adaaf5ff15a64a02573113b0 100644 --- a/nfs4.1/server41tests/st_delegation.py +++ b/nfs4.1/server41tests/st_delegation.py @@ -301,22 +301,44 @@ def _testCbGetattr(t, env, change=0, size=0): sess1 = env.c1.new_client_session(b"%s_1" % env.testname(t)) sess1.client.cb_post_hook(OP_CB_GETATTR, getattr_post_hook) - fh, deleg = __create_file_with_deleg(sess1, env.testname(t), - OPEN4_SHARE_ACCESS_READ | - OPEN4_SHARE_ACCESS_WRITE | - OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG) + res = sess1.compound([op.putrootfh(), + op.getattr(nfs4lib.list2bitmap([FATTR4_SUPPORTED_ATTRS, + FATTR4_OPEN_ARGUMENTS]))]) + check(res) + caps = res.resarray[-1].obj_attributes + + openmask = (OPEN4_SHARE_ACCESS_READ | + OPEN4_SHARE_ACCESS_WRITE | + OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG) + + if caps[FATTR4_SUPPORTED_ATTRS] & FATTR4_OPEN_ARGUMENTS: + if caps[FATTR4_OPEN_ARGUMENTS].oa_share_access_want & OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS: + openmask |= 1< 0: cbattrs[FATTR4_SIZE] = size + if openmask & 1<