]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd-nbd: fix stuck with disable request
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Tue, 12 Sep 2023 12:15:05 +0000 (17:45 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Mon, 30 Oct 2023 17:29:21 +0000 (22:59 +0530)
commit3cb26e0b1ca22cfb2d5cd73ee7c5f5c3ae0049f3
tree1a76696304461e4bf2e34d00d78f5a7ed140fc03
parent4b8f23eb0a12bda682e595c022abcdedc3e4d440
rbd-nbd: fix stuck with disable request

Problem:
-------
Trying to disable any feature on an rbd image mapped with nbd leads to stuck
in rbd-nbd.

The rbd-nbd registers a watcher callback to detect image resize in
NBDWatchCtx::handle_notify(). The handle_notify calls image info method, which
calls refresh_if_required and it got stuck there.

It is getting stuck in ImageState::refresh_if_required() because
DisableFeaturesRequest issues update notifications while still holding onto
the exclusive lock with everything that has to do with it blocked.

Solution:
--------
Set only notify flag as part of NBDWatchCtx::handle_notify() and handle
the resize detection part as part of a different thread.

Fixes: https://tracker.ceph.com/issues/58740
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
(cherry picked from commit dbb4daff404c5d2da32c33f4e852e84a257c0b8d)
qa/workunits/rbd/rbd-nbd.sh
src/tools/rbd_nbd/rbd-nbd.cc