Skip to content

tentacle: librbd: fix ExclusiveLock::accept_request() when !is_state_locked()#66628

Merged
yuriw merged 2 commits intoceph:tentaclefrom
idryomov:wip-74168-tentacle
Feb 6, 2026
Merged

tentacle: librbd: fix ExclusiveLock::accept_request() when !is_state_locked()#66628
yuriw merged 2 commits intoceph:tentaclefrom
idryomov:wip-74168-tentacle

Conversation

@idryomov
Copy link
Copy Markdown
Contributor

Make ret_val out parameter required for the existing method and
introduce an overload taking just request_type to compensate.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 3327001)
To accept an async request, two conditions must be met: a) exclusive
lock must be a firm STATE_LOCKED state and b) async requests shouldn't
be blocked or if they are blocked there should be an exception in place
for a given request_type.  If a) is met but b) isn't, ret_val is set
to m_request_blocked_ret_val, as expected -- the reason for denying
the request is that async requests are blocked.  However, if a) isn't
met, ret_val also gets set to m_request_blocked_ret_val.  This is wrong
because the reason for denying the request in this case isn't that
async requests are blocked (they may or may not be) but a much heavier
circumstance of exclusive lock being in a transient state or not held
at all.

In such scenarios, whether async requests are blocked or not isn't
relevant and ExclusiveLock::accept_request() behaving otherwise can
lead to bogus "duplicate lock owners detected" errors getting raised
during an attempt to handle any maintenance operation notification in
ImageWatcher::handle_operation_request().  This error isn't considered
retryable so the entire operation that needed the exclusive lock would
be spuriously failed with EINVAL.

Fixes: https://tracker.ceph.com/issues/74168
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit e485589)
@idryomov idryomov added this to the tentacle milestone Dec 14, 2025
@idryomov idryomov requested a review from a team as a code owner December 14, 2025 21:11
@idryomov idryomov requested a review from pkalever December 14, 2025 21:12
@yuriw yuriw merged commit 137cf98 into ceph:tentacle Feb 6, 2026
13 of 14 checks passed
@idryomov idryomov deleted the wip-74168-tentacle branch February 6, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants