CephContext *cct = m_image_ctx->cct;
ldout(cct, 10) << this << " " << __func__ << ": r=" << r << dendl;
- if (r < 0) {
+ if (r < 0 && r != -ENOENT) {
lderr(cct) << "failed to open image: " << cpp_strerror(r) << dendl;
}
CephContext *cct = m_image_ctx->cct;
ldout(cct, 10) << this << " " << __func__ << " r=" << r << dendl;
- if (r < 0) {
+ if (r < 0 && r != -ENOENT) {
lderr(cct) << "failed to set snapshot: " << cpp_strerror(r) << dendl;
}
ldout(cct, 10) << __func__ << ": r=" << *result << dendl;
if (*result < 0) {
- lderr(cct) << "failed to stat image header: " << cpp_strerror(*result)
- << dendl;
+ if (*result != -ENOENT) {
+ lderr(cct) << "failed to stat image header: " << cpp_strerror(*result)
+ << dendl;
+ }
send_close_image(*result);
} else {
m_image_ctx->old_format = true;
RWLock::RLocker snap_locker(m_image_ctx.snap_lock);
m_snap_id = m_image_ctx.get_snap_id(m_snap_name);
if (m_snap_id == CEPH_NOSNAP) {
- lderr(cct) << "failed to locate snapshot '" << m_snap_name << "'"
- << dendl;
+ ldout(cct, 5) << "failed to locate snapshot '" << m_snap_name << "'"
+ << dendl;
*result = -ENOENT;
return m_on_finish;
r = tmap_rm(io_ctx, imgname);
old_format = (r == 0);
if (r < 0 && !unknown_format) {
- lderr(cct) << "error removing img from old-style directory: "
- << cpp_strerror(-r) << dendl;
+ if (r != -ENOENT) {
+ lderr(cct) << "error removing img from old-style directory: "
+ << cpp_strerror(-r) << dendl;
+ }
return r;
}
}
ldout(cct, 2) << "removing rbd image from directory..." << dendl;
r = cls_client::dir_remove_image(&io_ctx, RBD_DIRECTORY, imgname, id);
if (r < 0) {
- lderr(cct) << "error removing img from new-style directory: "
- << cpp_strerror(-r) << dendl;
+ if (r != -ENOENT) {
+ lderr(cct) << "error removing img from new-style directory: "
+ << cpp_strerror(-r) << dendl;
+ }
return r;
}
- }
+ }
ldout(cct, 2) << "done." << dendl;
return 0;
int r = ctx.wait();
if (r < 0) {
- lderr(ictx->cct) << "failed to " << (name.empty() ? "un" : "") << "set "
- << "snapshot: " << cpp_strerror(r) << dendl;
+ if (r != -ENOENT) {
+ lderr(ictx->cct) << "failed to " << (name.empty() ? "un" : "") << "set "
+ << "snapshot: " << cpp_strerror(r) << dendl;
+ }
return r;
}