Bug 15861 - Profile sync fails due to Directory Leases
Summary: Profile sync fails due to Directory Leases
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-22 16:02 UTC by Ralph Böhme
Modified: 2025-06-12 09:32 UTC (History)
2 users (show)

See Also:


Attachments
Patch for 4.22 backported from master (37.50 KB, patch)
2025-05-29 06:48 UTC, Ralph Böhme
bjacke: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2025-05-22 16:02:42 UTC
Windows profile sync ends up having directories open with DELETE_ACCESS with a RH Directory Lease when trying to rename an object into that directory.

We don't send the client a lease break which would give the client a chance to send us a cached close, but instead blindly apply the logic "if there's an existing open with DELETE_ACCESS the rename must fail with STATUS_SHARING_VIOLATION".

Fix that by sending the client a lease break and deferring the rename.
Comment 1 Samba QA Contact 2025-05-28 16:04:06 UTC
This bug was referenced in samba master:

e1a38cd3f9f5665c9f7dd202fec1c7ec72fa419c
56fe5e8ef192f38b928eed9b454709242f02699e
d88885b77cd9d86969eac2cd2010ed31e329106a
a2827f4d6d8b56de08adaee35a051022f255769e
8b346857b837259c017b47cb6a935ed54afc8c60
509081e7ed064899701a9e53b1597c33bcf5b77d
03c46342e2a65e6d81bd581471310c0ec2cbbdfb
1351b613679acb063d7ef8bc63d438e1ec973a9a
5d4565c1f974b75a1c080f4503613201ecaf7001
91b7a5e7ac308040bd60a172280e4429ee25f3b0
8c0888a94bbcd55b5746305ab82c9ce50095db32
69a7d5881bd0d91d270b4a8be4c75dcd94f19897
17ed8c0f9a0ab8b4b7feb213b4e3a0765f8cc0cd
9b9fc589e55d467c97fd4580c2d6d9aa8cb73b13
Comment 2 Ralph Böhme 2025-05-29 06:48:56 UTC
Created attachment 18648 [details]
Patch for 4.22 backported from master
Comment 3 Ralph Böhme 2025-05-29 16:04:30 UTC
Reassigning to Jule for inclusion in 4.22.
Comment 4 Jule Anger 2025-06-02 11:25:23 UTC
Pushed to autobuild-v4-22-test.
Comment 5 Samba QA Contact 2025-06-05 11:56:19 UTC
This bug was referenced in samba v4-22-test:

b58ffb3b149c95a283b8828c36f07a1bff671dfd
0939ddae86b7a66421c864ddb909a877bba9bc92
31f4023ce9ffb9a682cdbec540417432221f12a9
edd94c6d70958e598bbda553cfc878b3663f6f3e
e23cddcc2e6333c7ebab5bcb3d1d12bb5b9a470c
4c62ed110876382d252180068d1a83e7e6bb58b4
b171beb860c6c70e009a6f0b402b34ca601935ae
2b8ac68790ff3b8d2ce5bcdc509bf3417b6f9dcb
4874eb99e6e62b4289eece67db157b16196a32cb
9b651c01be1add9dbee06a6bc2ca9022247d4408
44811da2e66272412967886623762008036c4690
4cc5ed62dd340fc718843befcf7d0a1fccf1d8b5
0527b0070319046f32a5594aea5c0a9c9947e883
43698c834c39c7ddf25d39cfe426c3d34c8d4048
Comment 6 Samba QA Contact 2025-06-05 15:42:02 UTC
This bug was referenced in samba v4-22-stable (Release samba-4.22.2):

b58ffb3b149c95a283b8828c36f07a1bff671dfd
0939ddae86b7a66421c864ddb909a877bba9bc92
31f4023ce9ffb9a682cdbec540417432221f12a9
edd94c6d70958e598bbda553cfc878b3663f6f3e
e23cddcc2e6333c7ebab5bcb3d1d12bb5b9a470c
4c62ed110876382d252180068d1a83e7e6bb58b4
b171beb860c6c70e009a6f0b402b34ca601935ae
2b8ac68790ff3b8d2ce5bcdc509bf3417b6f9dcb
4874eb99e6e62b4289eece67db157b16196a32cb
9b651c01be1add9dbee06a6bc2ca9022247d4408
44811da2e66272412967886623762008036c4690
4cc5ed62dd340fc718843befcf7d0a1fccf1d8b5
0527b0070319046f32a5594aea5c0a9c9947e883
43698c834c39c7ddf25d39cfe426c3d34c8d4048
Comment 7 John Michael Drescher 2025-06-06 14:05:24 UTC
Does this apply to 4.21? If so are there plans for backporting this patch?
Comment 8 Ralph Böhme 2025-06-06 15:08:24 UTC
(In reply to John Michael Drescher from comment #7)
Directory Leases are only in 4.22.
Comment 9 John Michael Drescher 2025-06-06 19:09:27 UTC
Thank You!
Comment 10 Jule Anger 2025-06-12 09:32:48 UTC
Closing out bug report.

Thanks!