Project

General

Profile

Actions

Bug #607

closed

osd: ReplicatedPG: sub_op_modify: fix creation of ObjectState

Added by Colin McCabe over 13 years ago. Updated over 12 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

There's a part of the ReplicatedPG::sub_op_modify code that goes like this:

>       // do op
> ObjectState obs(op->poid, op->oloc);
> obs.oi.version = op->old_version;
> obs.oi.size = op->old_size;
> obs.exists = op->old_exists;
>
> rm->ctx = new OpContext(op, op->reqid, op->ops, &obs, this);
>
> rm->ctx->mtime = op->mtime;
> rm->ctx->at_version = op->version;
> rm->ctx->snapc = op->snapc;
>
> SnapSetContext ssc(op->poid.oid);
> ssc.snapset = op->snapset;
> rm->ctx->obs->ssc = &ssc;
>
> prepare_transaction(rm->ctx);
> log_op(rm->ctx->log, op->pg_trim_to, rm->ctx->local_t);
>
> rm->tls.push_back(&rm->ctx->op_t);
> rm->tls.push_back(&rm->ctx->local_t);
> }

Well, first of all, ObjectState is a local variable that goes out of scope at the end of this block, so we should never keep its address around afterwards. Secondly, we need to somehow figure out how to set ObjectState's object_info_t so that it knows if the object is lost, rather than just always assuming that it's not.

Actions #1

Updated by Sage Weil over 12 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF