Merge pull request #6347 from xiexingguo/xxg-wip-13566

osd: fixes for several cases where op result code was not checked or set

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2015-11-11 09:07:15 -05:00
commit c8e47d11b6

View File

@ -5277,7 +5277,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
newop.op.op = CEPH_OSD_OP_SYNC_READ;
newop.op.extent.offset = 0;
newop.op.extent.length = 0;
do_osd_ops(ctx, nops);
result = do_osd_ops(ctx, nops);
osd_op.outdata.claim(newop.outdata);
}
break;
@ -5336,7 +5336,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
::encode(m, newbl);
newop.indata = newbl;
}
do_osd_ops(ctx, nops);
result = do_osd_ops(ctx, nops);
assert(result == 0);
}
break;
@ -5443,7 +5444,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
}
++ctx->num_read;
{
osd->store->omap_get_header(coll, ghobject_t(soid), &osd_op.outdata);
result = osd->store->omap_get_header(coll, ghobject_t(soid), &osd_op.outdata);
if (result < 0)
break;
ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
ctx->delta_stats.num_rd++;
}
@ -5464,7 +5467,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
tracepoint(osd, do_osd_op_pre_omapgetvalsbykeys, soid.oid.name.c_str(), soid.snap.val, list_entries(keys_to_get).c_str());
map<string, bufferlist> out;
if (pool.info.supports_omap()) {
osd->store->omap_get_values(coll, ghobject_t(soid), keys_to_get, &out);
result = osd->store->omap_get_values(coll, ghobject_t(soid), keys_to_get, &out);
if (result < 0)
break;
} // else return empty omap entries
::encode(out, osd_op.outdata);
ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
@ -5499,12 +5504,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
i != assertions.end();
++i)
to_get.insert(i->first);
int r = osd->store->omap_get_values(coll, ghobject_t(soid),
result = osd->store->omap_get_values(coll, ghobject_t(soid),
to_get, &out);
if (r < 0) {
result = r;
if (result < 0)
break;
}
} // else leave out empty
//Should set num_rd_kb based on encode length of map