From: Jianpeng Ma Date: Mon, 21 Sep 2015 06:12:39 +0000 (+0800) Subject: osd/ReplicatedPG: If object exist and not whiteout, don't do touch for X-Git-Tag: v10.0.1~34^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d6b30dea33f4102d80dbe8cf1467b9439c056a04;p=ceph.git osd/ReplicatedPG: If object exist and not whiteout, don't do touch for create. Also, if object is whiteout, it need transaction op to update xattr which chanage whiteout to no-whiteout. For this we can use nop rather that touch. Signed-off-by: Jianpeng Ma --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index cfda5b00dfd8..cc2c26879bcf 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4764,10 +4764,12 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) // category is no longer implemented. } if (result >= 0) { + bool is_whiteout = obs.exists && oi.is_whiteout(); if (maybe_create_new_object(ctx)) { - ctx->mod_desc.create(); - } - t->touch(soid); + ctx->mod_desc.create(); + t->touch(soid); + } else if (is_whiteout) //change whiteout to non-whiteout, it need a op to update xattr. + t->nop(); } } }