]> git-server-git.apps.pok.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:31:28 +0000 (23:01 +0530)
commit221305759db2fd792a2cfea9c621125464e53bc5
tree04e1dfdbb469fbdc25bed315f63bc4be6f8c38d8
parentc8f5775915a15c8583a7a213d8abba8c9f7e9f48
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