]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: For object op, first check object whether unfound.
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 13 Apr 2015 03:20:52 +0000 (11:20 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Wed, 22 Apr 2015 01:47:50 +0000 (09:47 +0800)
If object unfound, asap return -EIO.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/osd/ReplicatedPG.cc

index 1f9bbb1580ccefb3801e254370e77e5b9c5a1dd1..b74c8dd848d1cf04d5de4d237e20692218ca8d09 100644 (file)
@@ -1400,6 +1400,11 @@ void ReplicatedPG::do_op(OpRequestRef& op)
                 CEPH_NOSNAP, m->get_pg().ps(),
                 info.pgid.pool(), m->get_object_locator().nspace);
 
+  if (missing_loc.is_unfound(head)) {
+    dout(10) << "do_op " << head << " is unfound, can't do anything" << dendl;
+    osd->reply_op_error(op, -EIO);
+    return;
+  }
 
   if (write_ordered && scrubber.write_blocked_by_scrub(head)) {
     dout(20) << __func__ << ": waiting for scrub" << dendl;
@@ -1424,6 +1429,11 @@ void ReplicatedPG::do_op(OpRequestRef& op)
   hobject_t snapdir(m->get_oid(), m->get_object_locator().key,
                    CEPH_SNAPDIR, m->get_pg().ps(), info.pgid.pool(),
                    m->get_object_locator().nspace);
+  if (missing_loc.is_unfound(snapdir)) {
+    dout(10) << "do_op " << snapdir << " is unfound, can't do anything" << dendl;
+    osd->reply_op_error(op, -EIO);
+    return;
+  }
   if (is_unreadable_object(snapdir)) {
     wait_for_unreadable_object(snapdir, op);
     return;