From: Jianpeng Ma Date: Thu, 9 Mar 2017 13:57:26 +0000 (+0800) Subject: osd/PrimaryLogPG: remove duplicated code. X-Git-Tag: v12.0.1~97^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13894%2Fhead;p=ceph.git osd/PrimaryLogPG: remove duplicated code. In fact, the following code in this function >> if (op->may_write()) { >> .... >> // invalid? >> if (m->get_snapid() != CEPH_NOSNAP) { >> dout(20) << __func__ << ": write to clone not valid " << *m << dendl; >> osd->reply_op_error(op, -EINVAL); >> return; >> } has the same function. So remove the duplicated code. Signed-off-by: Jianpeng Ma --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index c1d79481832c..97f06ecfb00e 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1962,13 +1962,6 @@ void PrimaryLogPG::do_op(OpRequestRef& op) wait_for_degraded_object(snapdir, op); return; } - - // asking for SNAPDIR is only ok for reads - if (m->get_snapid() == CEPH_SNAPDIR && op->may_write()) { - dout(20) << __func__ << ": write to snapdir not valid " << *m << dendl; - osd->reply_op_error(op, -EINVAL); - return; - } // dup/resent? if (op->may_write() || op->may_cache()) {