Skip to contentSkip to conversation

BLOCK3: send an empty extent list in the second LAYOUTCOMMIT

PATCH New Daejun Park 1 participant 1 message Oct 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 BLOCK3: send an empty extent list in the second LAYOUTCOMMIT

Under Python 3, BLOCK3 fails on every server with a TypeError: its second LAYOUTCOMMIT passes the str "" as the layout body. Send an empty pnfs_block_layoutupdate4 (RFC 5663, section 2.3.2) instead. It holds an extent count of zero.

---
With b"" (the zero-length body BLOCK3 was written to send), nfsd answers NFS4ERR_BADXDR. With this patch, BLOCK3 passes on Linux nfsd over XFS (mainline 65ba8f34ec88).

---
 nfs4.1/server41tests/st_block.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
nfs4.1/server41tests/st_block.py +4 -2
index 3cfc1c6..d43b7d5 100644
@@ -158,7 +158,9 @@ def testEmptyCommit(t, env):
                            layoutupdate4(LAYOUT4_BLOCK_VOLUME, p.get_buffer()))]
     res = sess.compound(ops)
     check(res)
-    # Send another LAYOUTCOMMIT, with an empty opaque
+    # Send another LAYOUTCOMMIT, with an empty extent list
+    p = BlockPacker()
+    p.pack_pnfs_block_layoutupdate4(pnfs_block_layoutupdate4([]))
     time = newtime4(True, get_nfstime())
     ops = [op.putfh(fh),
            op.layoutcommit(extent.bex_file_offset,
@@ -166,7 +168,7 @@ def testEmptyCommit(t, env):
                            False, lo_stateid2,
                            newoffset4(True, 2 * 8192 - 1),
                            time,
-                           layoutupdate4(LAYOUT4_BLOCK_VOLUME, ""))]
+                           layoutupdate4(LAYOUT4_BLOCK_VOLUME, p.get_buffer()))]
     res = sess.compound(ops)
     check(res)
 

---
base-commit: cd4701827a8261fedbfb4c6e39029fb9671321a6
change-id: 20261029-pynfs-block-empty-commit-7d7832b5a225

Best regards,

Signature · 1 line
Daejun Park <[email protected]>