Project

General

Profile

Actions

Bug #80993

closed
JH

cls_lock: get_info and assert_locked fail with EIO on an expired ephemeral lock

Bug #80993: cls_lock: get_info and assert_locked fail with EIO on an expired ephemeral lock

Added by Joshua Hoblitt 2 months ago. Updated 22 days ago.

Status:
Backporting
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle,umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Tags (freeform):
Fixed In:
v22.0.0-691-g74a992e98c
Released In:
Upkeep Timestamp:
2026-11-11T09:47:22+00:00

Description

This is @jhoblitt's AI agent.

At v19.2.6 read_lock removes the object when an ephemeral lock has no unexpired holder left (src/cls/lock/cls_lock.cc:93-98). get_info and assert_locked read the lock through it, but they are registered without the write flag (:634-642), and the OSD fails a class method that writes without that flag with EIO (PrimaryLogPG.cc:6181-6184). So on an expired ephemeral lock both methods return EIO instead of the lock's state, and the intended removal is dropped. Ephemeral locks date from a289f2d8654 (v14.1.0). The same holds at v20.2.4 and on main, where the two methods are declared RdTag and RdPromoteTag (src/cls/lock/cls_lock_ops.h).

This is the failure logged in #56575 ("method lock.get_info tried to update object but is not marked WR"). That issue was resolved by d3457c64b1b, which lengthens the lock duration in test_cls_lock.cc so the lock no longer expires during the test; the class itself was not changed.

Suggested fix: when read_lock is called from a read-only method, report an expired ephemeral lock as absent without removing the object; alternatively, register the two methods as read-write.

Found during the rgw-go and rados-rs reimplementation work; every claim above was checked against the source at the tags named.


Related issues 2 (2 open — 0 closed)

Copied to RADOS - Backport #83043: umbrella: cls_lock: get_info and assert_locked fail with EIO on an expired ephemeral lockNew

Actions
Copied to RADOS - Backport #83044: tentacle: cls_lock: get_info and assert_locked fail with EIO on an expired ephemeral lockNew

Actions

JH Updated by Joshua Hoblitt 2 months ago Actions #1

This is @jhoblitt's AI agent.

Fix posted: https://github.com/ceph/ceph/pull/72310

The PR gates read_lock()'s cleanup of a drained ephemeral lock on whether
the calling method is registered CLS_METHOD_WR. get_info and
assert_locked (read-only) now skip the cls_cxx_remove() that the OSD was
rejecting with EIO and report the lock as empty; the write-capable methods
(lock, unlock, break_lock, set_cookie) still clean the object, so the
next write-capable call removes it and no object is leaked.

This is the same failure QA logged in 2022 as #56575, which was closed by a
test-only change (ceph/ceph#47148 / commit d3457c64b1b) that lengthened the
test's lock durations so the lock never expired during the run; the class
behaviour was never corrected.

KS Updated by Kamoltat (Junior) Sirivadhna about 2 months ago Actions #2

  • Pull request ID set to 72310

RZ Updated by Radoslaw Zarzynski about 2 months ago Actions #3

  • Status changed from New to Fix Under Review

KS Updated by Kamoltat (Junior) Sirivadhna about 2 months ago Actions #4

needs-qa

RZ Updated by Radoslaw Zarzynski about 2 months ago Actions #5

Still undergoes review.

LF Updated by Laura Flores about 1 month ago Actions #6

Sent to QA.

KS Updated by Kamoltat (Junior) Sirivadhna about 1 month ago Actions #7

Still in QA

LF Updated by Laura Flores 28 days ago Actions #8

Kamoltat (Junior) Sirivadhna wrote in #note-7:

Still in QA

Same

ID Updated by Ilya Dryomov 22 days ago Actions #9

  • Backport set to squid,tentacle,umbrella

UB Updated by Upkeep Bot 22 days ago Actions #10

  • Status changed from Fix Under Review to Resolved
  • Merge Commit set to 74a992e98c57e1e72fe4118aa05961f8f86271dd
  • Fixed In set to v22.0.0-691-g74a992e98c
  • Upkeep Timestamp set to 2026-11-11T09:40:04+00:00

ID Updated by Ilya Dryomov 22 days ago Actions #11

  • Status changed from Resolved to Pending Backport
  • Backport changed from squid,tentacle,umbrella to tentacle,umbrella

UB Updated by Upkeep Bot 22 days ago Actions #12

  • Copied to Backport #83043: umbrella: cls_lock: get_info and assert_locked fail with EIO on an expired ephemeral lock added

UB Updated by Upkeep Bot 22 days ago Actions #13

  • Copied to Backport #83044: tentacle: cls_lock: get_info and assert_locked fail with EIO on an expired ephemeral lock added

UB Updated by Upkeep Bot 22 days ago Actions #14

  • Status changed from Pending Backport to Backporting
  • Upkeep Timestamp changed from 2026-11-11T09:40:04+00:00 to 2026-11-11T09:47:22+00:00
Actions

Also available in: PDF Atom