From: Sage Weil Date: Wed, 15 Sep 2021 23:12:38 +0000 (-0400) Subject: osd/PrimaryLogPG: drop ops when pool has EIO flag X-Git-Tag: v17.1.0~797^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43177%2Fhead;p=ceph.git osd/PrimaryLogPG: drop ops when pool has EIO flag If the op doesn't have the SUPPORTSPOOLEIO flag (i.e., it is an old client), return with an explicit EIO. Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 6b1a3e52f45..fefe60c7477 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -2128,12 +2128,21 @@ void PrimaryLogPG::do_op(OpRequestRef& op) return; } int64_t poolid = get_pgid().pool(); - if (op->may_write()) { - - const pg_pool_t *pi = get_osdmap()->get_pg_pool(poolid); - if (!pi) { - return; + const pg_pool_t *pi = get_osdmap()->get_pg_pool(poolid); + if (!pi) { + return; + } + if (pi->has_flag(pg_pool_t::FLAG_EIO)) { + // drop op on the floor; the client will handle returning EIO + if (m->has_flag(CEPH_OSD_FLAG_SUPPORTSPOOLEIO)) { + dout(10) << __func__ << " discarding op due to pool EIO flag" << dendl; + } else { + dout(10) << __func__ << " replying EIO due to pool EIO flag" << dendl; + osd->reply_op_error(op, -EIO); } + return; + } + if (op->may_write()) { // invalid? if (m->get_snapid() != CEPH_NOSNAP) {