From 808897d7bd3dce06328c0a24682b22603f4df6d4 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Thu, 9 Mar 2017 21:57:26 +0800 Subject: [PATCH] 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 --- src/osd/PrimaryLogPG.cc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index c1d79481832..97f06ecfb00 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()) { -- 2.39.5