]> git.apps.os.sepia.ceph.com Git - ceph.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:33:07 +0000 (23:03 +0530)
commit68637d3e5e537d07a84ed112c01549f352f9e6fa
tree9ae71ab9f83d4459e37fda804e62bd7c12535294
parent4e49a878b40433ed41605aa34774d09b81eed5be
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