From 9f0825ca13320187ee9d763160ea2f49738f83f2 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Mon, 12 May 2014 16:37:16 -0700 Subject: [PATCH] OSD: verify that client ops are targeted correctly in the current epoch We were previously only looking at the epoch the op was sent in, which meant that if we had dropped responsibility somewhere between send_epoch and our current epoch, we would queue up the op until a new osdmap came along. If it never did, we could block all client IO against us... Fixes: #8338 Signed-off-by: Greg Farnum --- src/osd/OSD.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 220eac652723e..143d992048d17 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7857,6 +7857,13 @@ void OSD::handle_op(OpRequestRef op, OSDMapRef osdmap) return; } + // check against current map too + if (!osdmap->have_pg_pool(pgid.pool()) || + osdmap->get_pg_acting_role(pgid.pgid, whoami) < 0) { + dout(7) << "dropping; no longer have PG (or pool); client will retarget" << dendl; + return; + } + PG *pg = get_pg_or_queue_for_pg(pgid, op); if (pg) { op->send_map_update = share_map.should_send; -- 2.39.5