Project

General

Profile

Bug #20580

rbd map should warn when creating duplicate devices for the same image

Added by Jason Dillaman about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/11/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

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

Related issues

Copied to rbd - Backport #21268: luminous: rbd map should warn when creating duplicate devices for the same image Rejected

History

#1 Updated by Yanhu Cao about 2 years ago

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?

#3 Updated by Jos Collin about 2 years ago

  • Status changed from New to In Progress

#4 Updated by Jason Dillaman almost 2 years ago

  • Status changed from In Progress to Resolved

#5 Updated by Nathan Cutler almost 2 years ago

  • Status changed from Resolved to Pending Backport
  • Backport set to luminous

#6 Updated by Nathan Cutler almost 2 years ago

  • Copied to Backport #21268: luminous: rbd map should warn when creating duplicate devices for the same image added

#7 Updated by Jason Dillaman almost 2 years ago

  • Status changed from Pending Backport to Resolved
  • Backport deleted (luminous)

Not required for backport

Also available in: Atom PDF