From: Jason Dillaman Date: Thu, 28 Apr 2016 14:52:15 +0000 (-0400) Subject: librbd: reduce log level for interrupted maint ops X-Git-Tag: v10.2.1~28^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49cfb0e48014610d04233a6c7549bbc3756dd3f6;p=ceph.git librbd: reduce log level for interrupted maint ops Fixes: http://tracker.ceph.com/issues/15572 Signed-off-by: Jason Dillaman (cherry picked from commit 1617328402345c68bf5d54828da6d687e51ef42b) --- diff --git a/src/librbd/operation/FlattenRequest.cc b/src/librbd/operation/FlattenRequest.cc index cc4842ef53a..59bdb29302a 100644 --- a/src/librbd/operation/FlattenRequest.cc +++ b/src/librbd/operation/FlattenRequest.cc @@ -67,7 +67,10 @@ bool FlattenRequest::should_complete(int r) { I &image_ctx = this->m_image_ctx; CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " should_complete: " << " r=" << r << dendl; - if (r < 0 && !(r == -ENOENT && m_ignore_enoent) ) { + if (r == -ERESTART) { + ldout(cct, 5) << "flatten operation interrupted" << dendl; + return true; + } else if (r < 0 && !(r == -ENOENT && m_ignore_enoent) ) { lderr(cct) << "flatten encountered an error: " << cpp_strerror(r) << dendl; return true; } diff --git a/src/librbd/operation/RebuildObjectMapRequest.cc b/src/librbd/operation/RebuildObjectMapRequest.cc index 9b607fee12a..da2e744ce90 100644 --- a/src/librbd/operation/RebuildObjectMapRequest.cc +++ b/src/librbd/operation/RebuildObjectMapRequest.cc @@ -225,7 +225,10 @@ bool RebuildObjectMapRequest::should_complete(int r) { break; } - if (r < 0) { + if (r == -ERESTART) { + ldout(cct, 5) << "rebuild object map operation interrupted" << dendl; + return true; + } else if (r < 0) { lderr(cct) << "rebuild object map encountered an error: " << cpp_strerror(r) << dendl; return true; diff --git a/src/librbd/operation/ResizeRequest.cc b/src/librbd/operation/ResizeRequest.cc index 300fa8bd544..a2ee7b0ebe5 100644 --- a/src/librbd/operation/ResizeRequest.cc +++ b/src/librbd/operation/ResizeRequest.cc @@ -161,7 +161,10 @@ Context *ResizeRequest::handle_trim_image(int *result) { CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " " << __func__ << ": r=" << *result << dendl; - if (*result < 0) { + if (*result == -ERESTART) { + ldout(cct, 5) << "resize operation interrupted" << dendl; + return this->create_context_finisher(); + } else if (*result < 0) { lderr(cct) << "failed to trim image: " << cpp_strerror(*result) << dendl; return this->create_context_finisher(); } diff --git a/src/librbd/operation/SnapshotRollbackRequest.cc b/src/librbd/operation/SnapshotRollbackRequest.cc index 8bc5b3348db..6dcf3a71083 100644 --- a/src/librbd/operation/SnapshotRollbackRequest.cc +++ b/src/librbd/operation/SnapshotRollbackRequest.cc @@ -222,7 +222,10 @@ Context *SnapshotRollbackRequest::handle_rollback_objects(int *result) { CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " " << __func__ << ": r=" << *result << dendl; - if (*result < 0) { + if (*result == -ERESTART) { + ldout(cct, 5) << "snapshot rollback operation interrupted" << dendl; + return this->create_context_finisher(); + } else if (*result < 0) { lderr(cct) << "failed to rollback objects: " << cpp_strerror(*result) << dendl; return this->create_context_finisher(); diff --git a/src/librbd/operation/SnapshotUnprotectRequest.cc b/src/librbd/operation/SnapshotUnprotectRequest.cc index 65b71670dd8..5ca98f9d80a 100644 --- a/src/librbd/operation/SnapshotUnprotectRequest.cc +++ b/src/librbd/operation/SnapshotUnprotectRequest.cc @@ -259,7 +259,7 @@ void SnapshotUnprotectRequest::send_scan_pool_children() { boost::lambda::bind(boost::lambda::new_ptr >(), boost::lambda::_1, &image_ctx, pspec, pools, boost::lambda::_2)); AsyncObjectThrottle *throttle = new AsyncObjectThrottle( - this, image_ctx, context_factory, ctx, NULL, 0, pools.size()); + nullptr, image_ctx, context_factory, ctx, NULL, 0, pools.size()); throttle->start_ops(image_ctx.concurrent_management_ops); } diff --git a/src/librbd/operation/TrimRequest.cc b/src/librbd/operation/TrimRequest.cc index 8e32f3ec593..3ed96f792e3 100644 --- a/src/librbd/operation/TrimRequest.cc +++ b/src/librbd/operation/TrimRequest.cc @@ -122,7 +122,10 @@ bool TrimRequest::should_complete(int r) I &image_ctx = this->m_image_ctx; CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " should_complete: r=" << r << dendl; - if (r < 0) { + if (r == -ERESTART) { + ldout(cct, 5) << "trim operation interrupted" << dendl; + return true; + } else if (r < 0) { lderr(cct) << "trim encountered an error: " << cpp_strerror(r) << dendl; return true; }