Project

General

Profile

Actions

Bug #79952

closed
TH MK

MDS bug in the setfilelock path

Bug #79952: MDS bug in the setfilelock path

Added by Torsten Heinig 3 months ago. Updated 3 months ago.

Status:
Backporting
Priority:
High
Category:
Correctness/Safety
Target version:
Due date:
% Done:

0%

Source:
Community (dev)
Backport:
tentacle, squid, umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-3025-g71d0e86986
Released In:
Upkeep Timestamp:
2026-09-08T12:27:47+00:00

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:

https://github.com/ceph/ceph/pull/71369

This should be treated as a high-priority backport candidate.


Related issues 3 (1 open — 2 closed)

Copied to CephFS - Backport #80369: umbrella: MDS bug in the setfilelock pathFix Under ReviewJos Collin

Actions
Copied to CephFS - Backport #80370: squid: MDS bug in the setfilelock pathResolvedJos Collin

Actions
Copied to CephFS - Backport #80371: tentacle: MDS bug in the setfilelock pathResolvedJos Collin

Actions

XL Updated by Xiubo Li 3 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Target version set to v22.0.0
  • Source set to Community (dev)
  • Backport set to tentacle, squid, umbrella

XL Updated by Xiubo Li 3 months ago Actions #2

  • Priority changed from Normal to High

VS Updated by Venky Shankar 3 months ago Actions #3

  • 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 Actions #4

  • 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 Actions #5

  • Copied to Backport #80369: umbrella: MDS bug in the setfilelock path added

UB Updated by Upkeep Bot 3 months ago Actions #6

UB Updated by Upkeep Bot 3 months ago Actions #7

  • Copied to Backport #80371: tentacle: MDS bug in the setfilelock path added

UB Updated by Upkeep Bot 3 months ago Actions #8

  • 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
Actions

Also available in: PDF Atom