summaryrefslogtreecommitdiff
path: root/src/librbd.cc
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2012-04-24 09:43:44 -0700
committerSage Weil <sage@newdream.net>2012-04-24 13:39:38 -0700
commite51772ca1953e25119b010e446092756cf59fc8d (patch)
tree8c777b654bd4e12d494b5df926e8efa5fe0effba /src/librbd.cc
parentccf7d9309eac11ba214dc0e764ca3ee9267de46c (diff)
downloadceph-e51772ca1953e25119b010e446092756cf59fc8d.tar.gz
librbd: pass errors removing head back to user
In particular, the OSD may return EBUSY if there are still watchers. Ignore ENOENT, as that may indicate we are cleaning up a previously aborted removal. Fixes: #2311 Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/librbd.cc')
-rw-r--r--src/librbd.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librbd.cc b/src/librbd.cc
index 752d92e325f..463eaacc9eb 100644
--- a/src/librbd.cc
+++ b/src/librbd.cc
@@ -1026,7 +1026,11 @@ int remove(IoCtx& io_ctx, const char *imgname, ProgressContext& prog_ctx)
}
trim_image(io_ctx, header, 0, prog_ctx);
ldout(cct, 2) << "removing header..." << dendl;
- io_ctx.remove(md_oid);
+ r = io_ctx.remove(md_oid);
+ if (r < 0 && r != -ENOENT) {
+ lderr(cct) << "error removing header: " << cpp_strerror(-r) << dendl;
+ return r;
+ }
}
ldout(cct, 2) << "removing rbd image from directory..." << dendl;