Bug #20580
closed
rbd map should warn when creating duplicate devices for the same image
Added by Jason Dillaman almost 7 years ago.
Updated over 6 years ago.
Description
[ubuntu@magna079 ~]$ sudo rbd create test0 --image-format 2 --size 4096 --pool rbd
[ubuntu@magna079 ~]$ sudo rbd map test0 --pool rbd
/dev/rbd0
[ubuntu@magna079 ~]$ sudo rbd map test0 --pool rbd
/dev/rbd1
[ubuntu@magna079 ~]$ sudo rbd map test0 --pool rbd
/dev/rbd2
[ubuntu@magna079 ~]$ sudo rbd map test0 --pool rbd
/dev/rbd3
I think the same image should not be mapped more than once. I modified the kernel code(drivers/block/rbd.c), then rbd maps the same image and displays the warning message as shown below.
[root@ceph83 ceph-client]# rbd map disk01
/dev/rbd0
[root@ceph83 ceph-client]# rbd map disk01@snap02
/dev/rbd1
[root@ceph83 ceph-client]# rbd map disk01
rbd: sysfs write failed
In some cases useful info is found in syslog - try "dmesg | tail".
rbd: map failed: (5) Input/output error
[root@ceph83 ceph-client]# rbd map disk01@snap02
rbd: sysfs write failed
In some cases useful info is found in syslog - try "dmesg | tail".
rbd: map failed: (5) Input/output error
[root@ceph83 ceph-client]# dmesg | tail
[ 1873.304577] rbd: rbd0: capacity 10737418240 features 0x1
[ 1876.055049] rbd: rbd0: 'rbd/disk01@-' already mapped
[ 1891.184957] rbd: rbd1: capacity 10737418240 features 0x1
[ 1894.303466] rbd: rbd1: 'rbd/disk01@snap02' already mapped
Any suggestions?
- Status changed from New to In Progress
- Status changed from In Progress to Resolved
- Status changed from Resolved to Pending Backport
- Backport set to luminous
- Copied to Backport #21268: luminous: rbd map should warn when creating duplicate devices for the same image added
- Status changed from Pending Backport to Resolved
- Backport deleted (
luminous)
Not required for backport
Also available in: Atom
PDF