Bug #79952
closedMDS bug in the setfilelock path
0%
Description
This is a fix for a critical MDS bug in the setfilelock path. The issue is easy to trigger and can leave flock-style locks stuck until the MDS is restarted. The root cause is in handle_client_file_setlock(): it treated “owner has a request on the waiting list” and “owner holds a lock” as mutually exclusive. During a lock upgrade, both can be true at once. A subsequent unlock can leave a stale entry in held_locks without any actual lock holder, and later exclusive lock attempts can block forever in “failed to add lock, waiting”.
This is severe because the trigger is simple and recovery is limited to restarting the MDS; client eviction does not clear the bogus state. The fix is to cancel the waiting entry when present and, unless the request is an interrupt, also remove the held lock. The PR includes a Python reproducer and a regression test for the Ceph QA suite:
This should be treated as a high-priority backport candidate.
VS Updated by Venky Shankar 3 months ago
- Project changed from Ceph to CephFS
- Category set to Correctness/Safety
- Assignee set to Max Kellermann
- Component(FS) MDS added
UB Updated by Upkeep Bot 3 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to 71d0e86986c4d86af63b3fc06da514800f9b42e5
- Fixed In set to v21.3.0-3025-g71d0e86986
- Upkeep Timestamp set to 2026-09-08T05:38:50+00:00
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80369: umbrella: MDS bug in the setfilelock path added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80370: squid: MDS bug in the setfilelock path added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80371: tentacle: MDS bug in the setfilelock path added
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Upkeep Timestamp changed from 2026-09-08T05:38:50+00:00 to 2026-09-08T12:27:47+00:00