From 3e387d62ed95898db8a7d7163c2bacc363b8f617 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 6 May 2014 11:01:27 -0700 Subject: [PATCH] osd/ReplicatedPG: fix whiteouts for other cache mode We were special casing WRITEBACK mode for handling whiteouts; this needs to also include the FORWARD and READONLY modes. To avoid having to list specific cache modes, though, just check != NONE. Fixes: #8296 Backport: firefly Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index be5cefb834b85..94eec05d44458 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4619,8 +4619,8 @@ inline int ReplicatedPG::_delete_oid(OpContext *ctx, bool no_whiteout) } oi.size = 0; - // cache: writeback: set whiteout on delete? - if (pool.info.cache_mode == pg_pool_t::CACHEMODE_WRITEBACK && !no_whiteout) { + // cache: cache: set whiteout on delete? + if (pool.info.cache_mode != pg_pool_t::CACHEMODE_NONE && !no_whiteout) { dout(20) << __func__ << " setting whiteout on " << soid << dendl; oi.set_flag(object_info_t::FLAG_WHITEOUT); ctx->delta_stats.num_whiteouts++; @@ -5088,7 +5088,7 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx) } // cache: clear whiteout? - if (pool.info.cache_mode == pg_pool_t::CACHEMODE_WRITEBACK) { + if (pool.info.cache_mode != pg_pool_t::CACHEMODE_NONE) { if (ctx->user_modify && ctx->obc->obs.oi.is_whiteout()) { dout(10) << __func__ << " clearing whiteout on " << soid << dendl; -- 2.39.5