From: Sage Weil Date: Tue, 6 May 2014 18:01:27 +0000 (-0700) Subject: osd/ReplicatedPG: fix whiteouts for other cache mode X-Git-Tag: v0.81~58^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1774%2Fhead;p=ceph.git 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index be5cefb834b8..94eec05d4445 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;