Bug 15865 - SMB2 Lease Break(breaking1 subtest) Test Regression on FreeBSD/Samba 4.22 (req2->cancel.can_cancel always false)
Summary: SMB2 Lease Break(breaking1 subtest) Test Regression on FreeBSD/Samba 4.22 (re...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: smbtorture (show other bugs)
Version: 4.22.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-02 04:52 UTC by Sandeep Kumar(Panzura)
Modified: 2025-06-02 04:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandeep Kumar(Panzura) 2025-06-02 04:52:18 UTC
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.
Comment 1 Sandeep Kumar(Panzura) 2025-06-02 04:53:03 UTC
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.