From: Lucian Petrut Date: Wed, 17 Feb 2021 13:27:11 +0000 (+0000) Subject: rbd: fix rbd-wnbd device status X-Git-Tag: v17.1.0~2883^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94cf22e35217e33a48ab73a018c8b1015b887ca4;p=ceph.git rbd: fix rbd-wnbd device status The "rbd-wnbd show" command will always report the device status as "inactive". This patch adds the missing check, similar to the one used by the "list" command. Signed-off-by: Lucian Petrut --- diff --git a/src/tools/rbd_wnbd/rbd_wnbd.cc b/src/tools/rbd_wnbd/rbd_wnbd.cc index a4b0cf29bd0f..0b4cbb650c2b 100644 --- a/src/tools/rbd_wnbd/rbd_wnbd.cc +++ b/src/tools/rbd_wnbd/rbd_wnbd.cc @@ -1345,6 +1345,7 @@ static int do_show_mapped_device(std::string format, bool pretty_format, } auto conn_props = conn_info.Properties; + cfg.active = conn_info.DiskNumber > 0 && is_process_running(conn_props.Pid); f->open_object_section("device"); f->dump_int("id", conn_props.Pid ? conn_props.Pid : -1); f->dump_string("device", cfg.devpath);