reset ssc->exsits in finish_ctx() if the ctx->cache_evict is true, and
the head is removed.
Fixes: #12748
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
b61f3e43f1c9d43daa0dedd7cbd0fe5787cbdfbb)
// apply new object state.
ctx->obc->obs = ctx->new_obs;
- if (!maintain_ssc && soid.is_head()) {
+ if (soid.is_head() && !ctx->obc->obs.exists &&
+ (!maintain_ssc || ctx->cache_evict)) {
ctx->obc->ssc->exists = false;
ctx->obc->ssc->snapset = SnapSet();
} else {