]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-nbd: fix ebusy when do map 21142/head
authorLi Wang <laurence.liwang@gmail.com>
Thu, 7 Dec 2017 14:03:45 +0000 (22:03 +0800)
committerLi Wang <laurence.liwang@gmail.com>
Fri, 30 Mar 2018 14:09:03 +0000 (14:09 +0000)
commitab77dcc0170c0d63795fe0d50427cda630bfd593
tree28ece91839ce875e68619c9953563166221bcb34
parent9e8af3e243185df3e9319f987e472039e15e7d4d
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>
src/tools/rbd_nbd/rbd-nbd.cc