diff options
author | Jason Dillaman <dillaman@redhat.com> | 2016-01-05 18:29:13 +0100 |
---|---|---|
committer | Jason Dillaman <dillaman@redhat.com> | 2016-01-05 18:29:13 +0100 |
commit | 5b065aae75992411f4f3f7b945e757eb4cda019e (patch) | |
tree | 1127a4521c6f4ab9f8e2f67d87d0c3a1acc7d581 /src | |
parent | Revert "rgw: use smart pointer for C_Reinitwatch" (diff) | |
download | ceph-5b065aae75992411f4f3f7b945e757eb4cda019e.tar.xz ceph-5b065aae75992411f4f3f7b945e757eb4cda019e.zip |
librbd: reduce verbosity of common error condition logging
Fixes: #14234
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/librbd/ImageState.cc | 4 | ||||
-rw-r--r-- | src/librbd/image/OpenRequest.cc | 6 | ||||
-rw-r--r-- | src/librbd/image/SetSnapRequest.cc | 4 | ||||
-rw-r--r-- | src/librbd/internal.cc | 20 |
4 files changed, 21 insertions, 13 deletions
diff --git a/src/librbd/ImageState.cc b/src/librbd/ImageState.cc index 10fd9765253..1bf628eb2b2 100644 --- a/src/librbd/ImageState.cc +++ b/src/librbd/ImageState.cc @@ -273,7 +273,7 @@ void ImageState<I>::handle_open(int r) { 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; } @@ -376,7 +376,7 @@ void ImageState<I>::handle_set_snap(int r) { 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; } diff --git a/src/librbd/image/OpenRequest.cc b/src/librbd/image/OpenRequest.cc index f8fb8e977b4..cb0979aec6a 100644 --- a/src/librbd/image/OpenRequest.cc +++ b/src/librbd/image/OpenRequest.cc @@ -72,8 +72,10 @@ Context *OpenRequest<I>::handle_v1_detect_header(int *result) { 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; diff --git a/src/librbd/image/SetSnapRequest.cc b/src/librbd/image/SetSnapRequest.cc index 89b56739a35..9e175b21ef0 100644 --- a/src/librbd/image/SetSnapRequest.cc +++ b/src/librbd/image/SetSnapRequest.cc @@ -122,8 +122,8 @@ Context *SetSnapRequest<I>::handle_block_writes(int *result) { 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; diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 35b3003adba..4172f451701 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2097,8 +2097,10 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { 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; } } @@ -2131,11 +2133,13 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { 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; @@ -2498,8 +2502,10 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { 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; } |