From: runsisi Date: Fri, 8 Jul 2016 12:57:30 +0000 (+0800) Subject: osd/ReplicatedPG: remove redundant check for balance/localize read X-Git-Tag: v11.1.1~90^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=614b04fab4f8e13f4511c45b9737e6d8d1ac41f5;p=ceph.git osd/ReplicatedPG: remove redundant check for balance/localize read given an op if the PG is a replica and is able to handle it, then the op must have the BALANCE_READS or LOCALIZE_READS flag(s) set, otherwise the op was misdirected and had been rejected at the every beginning of the function. Signed-off-by: runsisi --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 00232aeda570..4bb12058815e 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1837,12 +1837,9 @@ void ReplicatedPG::do_op(OpRequestRef& op) &missing_oid); if (r == -EAGAIN) { - // If we're not the primary of this OSD, and we have - // CEPH_OSD_FLAG_LOCALIZE_READS set, we just return -EAGAIN. Otherwise, + // If we're not the primary of this OSD, we just return -EAGAIN. Otherwise, // we have to wait for the object. - if (is_primary() || - (!(m->has_flag(CEPH_OSD_FLAG_BALANCE_READS)) && - !(m->has_flag(CEPH_OSD_FLAG_LOCALIZE_READS)))) { + if (is_primary()) { // missing the specific snap we need; requeue and wait. assert(!op->may_write()); // only happens on a read/cache wait_for_unreadable_object(missing_oid, op);