From patchwork Thu Sep 5 18:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13792782 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 EE63B158D66 for ; Thu, 5 Sep 2024 18:17:03 +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=1725560224; cv=none; b=PanZFMJjBlnxO4/JGZpeCgwlVvsZyn0++QqjjWGfvr29Rp3bOVwHlmYW1f7aXdrASoup30/uVk+5pK0d1slBrfPb7MGG743V032OdY/AYU+rlDs+v+aXfOYDlzL8ujsTULrKmjM7IpM7iktjkNqhocMBJ7YYpPGNDE2T9qK2iHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725560224; c=relaxed/simple; bh=fpGlx19LirBoyfvbhwbh+Lxynm7wPL1Pt5mWQ2uLvMI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bjm2gYBZbx4i4Nj+jAAlohJsxuGlVmxXKFtJJeelz+brXbBX5a+rxWOnKNuEbCGp1A/UbfOYEZmc7N+2wY/9EukYUieR+0o5rZhbpFk7ZBzRNhOc4zRkLldt2hYMazpJ2OzBGtH0wqnDjm7F/GAp9VRX1maq8VoidQiGhavwvAY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o1MLRaoF; 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="o1MLRaoF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37745C4CEC6; Thu, 5 Sep 2024 18:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725560223; bh=fpGlx19LirBoyfvbhwbh+Lxynm7wPL1Pt5mWQ2uLvMI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=o1MLRaoFQy3NRQ7dVv1kqLIizGQSBZXbZUZaJY+uRBEE/ieizTx50B7stZvLA8U2Q v4ABsnLDu2suGPSWJq+/8VxxlOfulAU1/SmancdEJxFRR6NyQJ9pwNcGDG5Ka9T/df 7xkxIqyyjMDEMz0aNZXg2uoCQYYlXWCGf9pRMkLuspAXMgRpk7vmNEzfbjbyKPU8OK 59a5aFnuYWJ+MxqgGRUjty58u+Jrr1h0ce+X/jB+SAY/Z7U6FYU/1XPaHyFcCFvSVb NhJ2kdEKyrpsaXePBiYrs4Y8ao2fQpXQEJXi0fBuGE3UPSRqFwcDDkYnByFUdH3SSO LqQJIZpqd3mkQ== From: Jeff Layton Date: Thu, 05 Sep 2024 14:16:57 -0400 Subject: [PATCH pynfs 1/2] 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: <20240905-cb_getattr-v1-1-0af05c68234f@kernel.org> References: <20240905-cb_getattr-v1-0-0af05c68234f@kernel.org> In-Reply-To: <20240905-cb_getattr-v1-0-0af05c68234f@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1074; i=jlayton@kernel.org; h=from:subject:message-id; bh=fpGlx19LirBoyfvbhwbh+Lxynm7wPL1Pt5mWQ2uLvMI=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBm2fWeiORqubDnUR/H78zAiEEc7Z7Tq9Ut/7wql a0mLaRP1SeJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZtn1ngAKCRAADmhBGVaC FWUDD/4ziV5cglae2p6lpiRbnRpQOwnaTVS8bB4E/zQweRrLBc3m8cIr9x27IE1i7IznS96L0KL o36wMX7iF9FgI5CBCLwgP32T/PJ+Ka274a7Z6cUKE16a20jW7fzMSaKIsJY4sgOIIcRGdwKf4GG FQON4+Dtg235NAa/AbJ9mUxW/IzetlmkvqKsJpzU+uUSa1ojrsjaJtakQq7hRWLdk9lhs2J/Do/ m6KsM7qyjRLpOshXKLdBCk2xdUzuCK9U8ngq/5iMLIt09wl/PvEj+ReQ8Q3swgSGzYFiF2ab/1h ee/2PKW02EfmdzfJrVzCsVCV0C+I59QF2S1dv4XaTrcxVyjHBafNTrnuQjfu67atoKC7Cncct/3 E1VXci78iL2xhrQ9T+gM/WuNj6Zm84q6zPbytmxXiBWdR92va4GYzoEZJxKFJ+Id7/ga33N3hU2 1UkuzSnCA79oVGxSv5ElXM2zcr6C6/qP7EgGws+HA6Amo1aZTLBqKBGqWUzoBaT6GdXa1RhOXl2 f0idLm9jS71zTL2RZ6PmWaSiKmcnt3Wn5uurn8LPt34FcKc5N4G1BynvQWXuOq09F9it3PtYRe0 NMvWJlgBZ5NG6OtuLAFHSI1l5T2k1xHsa/FawXJK4s2n7ZYZ2FsPLVsROBKGOwGKmJ5/bDDuHpe 8+kjgh51A99YOfw== 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 220b3e0629aa..d15b2b827879 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 Thu Sep 5 18:16:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13792783 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 7642B17ADF7 for ; Thu, 5 Sep 2024 18:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725560224; cv=none; b=MMxDZ1sTCmu0cwSH6Ms1VKbaEUSuKdctWGK1zivHEiaRWFnx/fo5jTftOW07bBApyLwW8PRKLo6+chvAmM4goa5/SIqkYcDvQNpKDvvq0rlnfKhtoRvWotkFtwrws36tWwsRs1kG0UgD/ohrBh1nkNygQX6i4UlhwANWbnAPDy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725560224; c=relaxed/simple; bh=4YuuyJO6Ks9XTbe/WWpmwyebyxsD7gWUehfkyYQWk4c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ot/We34ssYkkp01ERg1/Dy4fYXOgx5SJf7QLOaiXfFNBBcZt6ETRUhpp3/8Ibp0v2Y/mmyaG8Gp8ct+bpzWD/LnyoEc54OS/SIFhpmwiv2nRMV0ULNWD6R+0Y9VHJZlJUsgWXn+6Di54JM/W7t5VQsQSQJ64ARYtt2RjdxqLpIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Mbjx/KmZ; 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="Mbjx/KmZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6BC8C4CECA; Thu, 5 Sep 2024 18:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725560224; bh=4YuuyJO6Ks9XTbe/WWpmwyebyxsD7gWUehfkyYQWk4c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Mbjx/KmZPhtLsOjWcGETDrjVXTaAMT626Xvs8gM5+qcY8MNlROXxX2syVVAghkJ22 sNIHOLRArqz9r5uTV1fzuCg9FhichlWou4FApzRWiup5/dxn9EOftU2LmUGKbCtOPm 7lMSHYb2bWiyK+Wnez/TSRUYCHuAnUYH4HEef8Qj24ViEdS2+Our4AzDfWV9IsKtre Y2LaBoE4boZ1W7biDvqMbriKgvrcR3dmbeBuhUtPfWuoBtMN2eXBukBKZWc0jumcXb +t6ywLWVRr9+frubI4p+98Dsa7GdwRtc75JUnl8FMMixTqPiGkML0qrZUJSeOb3i3m Mwz4u7y9BHL9g== From: Jeff Layton Date: Thu, 05 Sep 2024 14:16:58 -0400 Subject: [PATCH pynfs 2/2] 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: <20240905-cb_getattr-v1-2-0af05c68234f@kernel.org> References: <20240905-cb_getattr-v1-0-0af05c68234f@kernel.org> In-Reply-To: <20240905-cb_getattr-v1-0-0af05c68234f@kernel.org> To: Calum Mackay Cc: linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4914; i=jlayton@kernel.org; h=from:subject:message-id; bh=4YuuyJO6Ks9XTbe/WWpmwyebyxsD7gWUehfkyYQWk4c=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBm2fWeagXKaJ9YaF2zHTfHJro2SGH51I9z30CzO VTf3wodI9yJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZtn1ngAKCRAADmhBGVaC FVpFD/9Snl8dwgoASwv1nmAMH0FbkHRY60tH0Y7vWjN4DrX3Wh9hDtAcDFihPpRHG9u4oF+1U/0 ZyQWBdr3g9bQHtJUaXoRgOe++RP3WsT0/fRsHsYT/C8jV+uZbJPPirCUYdVbmIHOMh9lzM7Nm9e n6XTOqDjnl1sII7OzJvPi5EP6CtyhDmMRsMG1KGFSq+yBRojI+imjSJn0cXVlhdrjRzJbt8CMti 1oDkh5a7DtVp22jBovpcwhC74ijem/Grm42zdca/QjhOWbr7o5Vr8WZyIB/apaB2ewCCGO2J9Tj avQKKb/Ag/dB9/Q6T+utmynPR/fyjiqQNTftHSUUm+5ikkWdKPOkZ1D1aabAJaWqto1rGfOHCCz Fz7OO9YkTtud0k/i2SxIkuJcXHeeYF0rBaVHr7JQqpbMyiQRJ3IKyCWm2zS28I8qE/inyURTbiE j74BUBISlyBriOzh7KIi5tEXD/aGVpxygvESmJD6/KRfD1jTXX7c8MT4OYhVASAyEwpoAI+pY4A eGW1W89HBhnTAFxE81JwH88+NN7SoYBvX4bbXhVyu1pP2rCOIHIpJkIdi4PvbRVHO20UDWBGWfe TAITobynYhEnu2E2WoE6+znJzr9ZimZsF2kggIhhgpkFOlvOio6krUfbkNarBkabttGlo3vU7uC ddzo9uhjiM7GslA== 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 8ce64dd639c7..941cf4000a5f 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 80b0da28fbad..2aa73ba7acd0 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<