librbd: return actual error when detecting format fails during creation

This bit a couple users today, when bad osd caps resulted in a very
confusing error message.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2012-11-07 16:48:32 -08:00 committed by Sage Weil
parent ca9f93aa37
commit cda9e516b8

View File

@ -672,8 +672,8 @@ reprotect_and_return_err:
// make sure it doesn't already exist, in either format
int r = detect_format(io_ctx, imgname, NULL, NULL);
if (r != -ENOENT) {
lderr(cct) << "rbd image " << imgname << " already exists" << dendl;
return -EEXIST;
lderr(cct) << "Could not tell if " << imgname << " already exists" << dendl;
return r;
}
if (!order)