Project

General

Profile

Actions

Bug #3379

closed

rbd map + rbd mv: couldn't remove old source object

Added by Chris Dunlop over 11 years ago. Updated about 11 years ago.

Status:
Won't Fix
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

ceph @7477a081, linux-3.4.12

Using 'rbd mv' on a mapped object creates a "ghost" object that prevents
further use of the object name. E.g.:

# rbd create --size 400 xx
# rbd map xx
# rbd mv xx yy
2012-10-22 12:43:06.219088 7f0fb9205760 -1 librbd: warning: couldn't remove old source object (xx.rbd)
# rbd list
yy
# rbd showmapped
id    pool    image    snap    device
1    rbd    xx    -    /dev/rbd1
# rbd unmap /dev/rbd1
# rbd showmapped
<< empty >>
# rbd list
<< empty >>

At this point the name 'xx' is unavailable for further use, e.g.:

# rbd create --size 400 xx
create error: (17) File exists
2012-10-22 12:49:45.498121 7f897d624760 -1 librbd: rbd image xx already exists
# rbd mv yy xx
rename error: (17) File exists
2012-10-22 12:52:42.690820 7ff738c7a760 -1 librbd: rbd image xx already exists
# rbd rm yy
Removing image: 100% complete...done.
b4# rbd list    
b4# rbd create --size 400 xx
create error: (17) File exists
2012-10-22 12:53:16.729617 7fd8fd6bb760 -1 librbd: rbd image xx already exists

...aha! 'rbd rm' on the old name works:

# rbd rm xx
Removing image: 99% complete...failed.
delete error: (2) No such file or directory
2012-10-22 12:58:25.168371 7f1a0753c760 -1 librbd: error removing img from old-style directory: (2) No such file or directory
# rbd create --size 400 xx
# rbd list
xx

Perhaps 'rbd mv' should be disallowed on mapped objects as it is for 'rbd rm', e.g.:

# rbd create --size 400 xx
# rbd map xx
# rbd rm xx
Removing image: 99% complete...failed.
delete error: image still has watchers
This means the image is still open or the client using it crashed. Try again after closing/unmapping it or waiting 30s for the crashed client to timeout.
2012-10-22 13:01:59.283345 7f63aca86760 -1 librbd: error removing header: (16) Device or resource busy
# rbd list
xx
# rbd showmapped
id    pool    image    snap    device
1    rbd    xx    -    /dev/rbd1
<pre>
Actions

Also available in: Atom PDF