From: Nitzan Mordechai Date: Mon, 14 Apr 2025 11:50:23 +0000 (+0000) Subject: PrimeryLogPG: don't accept ops with mixed balance_reads and rwordered flags X-Git-Tag: v20.1.0~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b01c004b5dc342cbdfb7cb26b47f6afe6245599;p=ceph.git PrimeryLogPG: don't accept ops with mixed balance_reads and rwordered flags do_op can't accept mixed flag of rwordered and balance_read Fixes: https://tracker.ceph.com/issues/70715 Signed-off-by: Nitzan Mordechai (cherry picked from commit f68b2178a24613960fe1303ece413b24f3ea02e7) --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index e826b6c9c65e..13b800840fe3 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -2045,6 +2045,15 @@ void PrimaryLogPG::do_op(OpRequestRef& op) } } + // check for op with rwordered and rebalance or localize reads + if ((m->has_flag(CEPH_OSD_FLAG_BALANCE_READS) || m->has_flag(CEPH_OSD_FLAG_LOCALIZE_READS)) && + op->rwordered()) { + dout(4) << __func__ << ": rebelance or localized reads with rwordered not allowed " + << *m << dendl; + osd->reply_op_error(op, -EINVAL); + return; + } + if ((m->get_flags() & (CEPH_OSD_FLAG_BALANCE_READS | CEPH_OSD_FLAG_LOCALIZE_READS)) && op->may_read() &&