From: Enming Zhang Date: Wed, 13 Dec 2017 14:32:32 +0000 (+0800) Subject: PrimaryLogPG: define soid just before using it X-Git-Tag: v13.0.2~788^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0591f01568bb321735c68f8232b348c4937075d5;p=ceph.git PrimaryLogPG: define soid just before using it Define the soid just before using it to avoid a redundant definition if an error happens and function prepare_transaction returns directly. Signed-off-by: Enming Zhang --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 3f75eb5d443..a658abfbf5b 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7756,8 +7756,6 @@ int PrimaryLogPG::prepare_transaction(OpContext *ctx) { assert(!ctx->ops->empty()); - const hobject_t& soid = ctx->obs->oi.soid; - // valid snap context? if (!ctx->snapc.is_valid()) { dout(10) << " invalid snapc " << ctx->snapc << dendl; @@ -7808,6 +7806,7 @@ int PrimaryLogPG::prepare_transaction(OpContext *ctx) } } + const hobject_t& soid = ctx->obs->oi.soid; // clone, if necessary if (soid.snap == CEPH_NOSNAP) make_writeable(ctx);