On FreeBSD with Samba 4.22, the SMB2 lease break test (smb2.lease.breaking1.breaking1) fails because the second SMB2 create request (req2) is never in a cancelable state (req2->cancel.can_cancel is always false), even immediately after smb2_create_send(). This test passes on: FreeBSD/Samba 4.11 Ubuntu/Samba 4.22 The issue appears to be a regression or platform-specific behavioral change in Samba 4.22 on FreeBSD. Steps to Reproduce Platform: FreeBSD (13.3) Samba Version: 4.22.0rc4 (from FreeBSD ports/packages) Test: Run the selftest/torture test smb2.lease.breaking1.breaking1 (source: source4/torture/smb2/lease.c) Check: Insert a debug/assertion immediately after smb2_create_send(): code: req2 = smb2_create_send(tree, &io2); torture_assert(tctx, req2 != NULL, "smb2_create_send"); torture_assert(tctx, req2->cancel.can_cancel, "req2 can_cancel after send"); Result: The assertion fails; req2->cancel.can_cancel is always false.
What Was Expected: On FreeBSD/Samba 4.11 and Ubuntu/Samba 4.22, req2->cancel.can_cancel is true after smb2_create_send(), and the test passes. The test expects the conflicting open request to be in a cancelable state until the lease break is acknowledged. What Actually Happens: On FreeBSD/Samba 4.22, req2->cancel.can_cancel is always false, even immediately after sending the request. The test fails at the assertion: text ../../source4/torture/smb2/lease.c:2387: Expression `req2->cancel.can_cancel' failed: req2 can_cancel Disabling "SMB3 directory leases" (smb3 directory leases = no in smb.conf) does not change the outcome.