]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/ImageWatcher: kick-start ExclusiveLock state machine 53293/head
authorRamana Raja <rraja@redhat.com>
Mon, 14 Aug 2023 15:27:13 +0000 (11:27 -0400)
committerRamana Raja <rraja@redhat.com>
Tue, 5 Sep 2023 18:16:18 +0000 (14:16 -0400)
commit44133f19086501c9850a06f82af5b075c3253176
tree11b563a6e3091e49ffd6838d63a88070e450ab85
parentfc67d924930ebf9a4d41c9f9247b94162250400d
librbd/ImageWatcher: kick-start ExclusiveLock state machine

... that is stalled on waiting for lock and let it detect client
blocklisting. This would propagate the blocklist error to the caller
requesting an operation needing an exclusive lock.

When a caller requests a librbd operation that requires an exclusive
lock, the librbd client checks whether the exclusive lock is
held by another client. If the lock is held by another client, librbd
stalls its ExclusiveLock state machine and through its ImageWatcher
notifies the lock owner that it wants the exclusive lock. After
receiving the response from the lock owner, the ImageWatcher schedules
another lock request. Meanwhile if the client gets blocklisted, the
ImageWatcher fails to schedule another lock request and returns. The
ExclusiveLock state machine remains stalled and the blocklist error is
not propagated to the caller. Instead, when scheduling another lock
request, make the ImageWatcher call the ExclusiveLock state machine's
peer notification handler if the client is blocklisted. This allows
the Exclusive lock state machine to detect that the client has been
blocklisted in its send_acquire_lock() member function and propagate
the blocklist error to the caller.

Fixes: https://tracker.ceph.com/issues/61607
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit e66db76354093009c254aabce9e4654e27045375)
src/librbd/ImageWatcher.cc