]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: fail a non-blocking flush if the object is being scrubbed 3943/head
authorSamuel Just <sjust@redhat.com>
Thu, 20 Nov 2014 22:27:39 +0000 (14:27 -0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 11 Mar 2015 00:45:05 +0000 (01:45 +0100)
Fixes: #8011
Backport: firefly, giant
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 9b26de3f3653d38dcdfc5b97874089f19d2a59d7)

src/osd/ReplicatedPG.cc

index f1911c13f947b5ebe2cbeffb19aaa755f3b0fc8a..6de44e105a7d5bfe589e9ea7009a4e0fc7978640 100644 (file)
@@ -6395,6 +6395,19 @@ int ReplicatedPG::try_flush_mark_clean(FlushOpRef fop)
     return -EBUSY;
   }
 
+  if (!fop->blocking && scrubber.write_blocked_by_scrub(oid)) {
+    if (fop->op) {
+      dout(10) << __func__ << " blocked by scrub" << dendl;
+      requeue_op(fop->op);
+      requeue_ops(fop->dup_ops);
+      return -EAGAIN;    // will retry
+    } else {
+      osd->logger->inc(l_osd_tier_try_flush_fail);
+      cancel_flush(fop, false);
+      return -ECANCELED;
+    }
+  }
+
   // successfully flushed; can we clear the dirty bit?
   // try to take the lock manually, since we don't
   // have a ctx yet.