Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luminous: rbd: abort in listing mapped nbd devices when running in a container #19051

Merged
merged 2 commits into from Jan 31, 2018

Conversation

shinobu-x
Copy link
Contributor

In some container scenarios, the file '/sys/block/nbd0/pid'
in the container records the host pid of the process
which opened the device, therefore the file '/proc/pid/cmdline'
corresponding to the pid in the container does not exist,
in that case, 'rbd-nbd list-mapped' will cause the
following assertion failure, this patch fixes it.

src/tools/rbd_nbd/rbd-nbd.cc: In function 'int get_mapped_info(int, Config*)'
/src/tools/rbd_nbd/rbd-nbd.cc: 834: FAILED assert(ifs.is_open())
 ceph version 13.0.0-1632-gf9cfe84 (f9cfe84) mimic (dev)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x102) [0x7fc6b1054ba2]
 2: (()+0x15c58) [0x560cd4697c58]
 3: (main()+0x9) [0x560cd46937f9]
 4: (__libc_start_main()+0xf0) [0x7fc6b003f830]
 5: (_start()+0x29) [0x560cd46938f9]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
Aborted (core dumped)

Fixes: http://tracker.ceph.com/issues/22011

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
(cherry picked from commit 07d5b81)
In some container scenarios, the host may choose to
map a specific nbd device, for example, /dev/nbd6 into the
container, in that case, the nbd device available in the
container is not numbered from 0. The current unused
nbd device search function will return no result.
This patch fixes it.

Fixes: http://tracker.ceph.com/issues/22012

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
Reviewed-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
(cherry picked from commit be0f958)
@tchaikov tchaikov added this to the luminous milestone Nov 22, 2017
@smithfarm smithfarm changed the title luminous: abort in listing mapped nbd devices when running in a container luminous: rbd: abort in listing mapped nbd devices when running in a container Jan 28, 2018
Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yuriw
Copy link
Contributor

yuriw commented Jan 29, 2018

@yuriw yuriw merged commit f7778d4 into ceph:luminous Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants