]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-nbd: fix ebusy when do map 21230/head
authorLi Wang <laurence.liwang@gmail.com>
Thu, 7 Dec 2017 14:03:45 +0000 (22:03 +0800)
committerPrashant D <pdhange@redhat.com>
Wed, 4 Apr 2018 00:58:42 +0000 (20:58 -0400)
commit87688e9a755e322c4ac02efa158d3311c71386e9
tree204193fa5b8843c29a6128e03c5a836ef14ec1f5
parent8ebcd8d68d691d89659f3fad69afb68c8458aada
rbd-nbd: fix ebusy when do map

When doing rbd-nbd map, if the Ceph service is not available,
the codes will wait on rados.connect(), unless killing the process.
In that case, the close_nbd logic is skipped with NBD_CLEAR_SOCK ioctl
not called. On the CentOS 7 kernel, it leaves nbd->file not cleared, which
causes the subsequent map requests return EBUSY, this patch fixes it
by connecting Ceph first prior to calling NBD_SET_SOCK ioctl

Fixes: http://tracker.ceph.com/issues/23528
Signed-off-by: Li Wang <laurence.liwang@gmail.com>
(cherry picked from commit ab77dcc0170c0d63795fe0d50427cda630bfd593)
src/tools/rbd_nbd/rbd-nbd.cc