]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: reduce verbosity of common error condition logging 7114/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 5 Jan 2016 17:29:13 +0000 (12:29 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 5 Jan 2016 17:29:13 +0000 (12:29 -0500)
Fixes: #14234
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageState.cc
src/librbd/image/OpenRequest.cc
src/librbd/image/SetSnapRequest.cc
src/librbd/internal.cc

index 10fd9765253bca3be586634693885119dbb56631..1bf628eb2b26eeb054943464e789547162255352 100644 (file)
@@ -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;
   }
 
index f8fb8e977b4628850a96ffd2a6d60c19e36a29ee..cb0979aec6a120381b61923b306342176cfccf7e 100644 (file)
@@ -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;
index 89b56739a3586b30b14ad3924197e0ec55f9e0ad..9e175b21ef060906c291c421bb11a5f7c8d6fb2c 100644 (file)
@@ -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;
index 35b3003adbaa1c33aab0c2d0c90b3f3f3f1bbd53..4172f451701bbea05fb570799bc71d81c3ed3824 100644 (file)
@@ -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;
     }