Skip to contentSkip to conversation

osd/ReplicatedPG: set truncate_seq when handling CEPH_OSD_OP_APPEND

PATCH In review Yan, Zheng 2 participants 2 messages Sep 11, 2012 – Sep 12, 2012

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/1 osd/ReplicatedPG: set truncate_seq when handling CEPH_OSD_OP_APPEND

From: "Yan, Zheng" <[email protected]>

We need set truncate_seq when redirect the newop to CEPH_OSD_OP_WRITE, otherwise the code handles CEPH_OSD_OP_WRITE may quietly drop the data.

---
 src/osd/ReplicatedPG.cc | 1 +
 1 file changed, 1 insertion(+)
src/osd/ReplicatedPG.cc +1 -0
index f353090..fcd8be7 100644
@@ -2310,6 +2310,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
 	newop.op.op = CEPH_OSD_OP_WRITE;
 	newop.op.extent.offset = oi.size;
 	newop.op.extent.length = op.extent.length;
+	newop.op.extent.truncate_seq = oi.truncate_seq;
         newop.indata = osd_op.indata;
 	do_osd_ops(ctx, nops);
 	osd_op.outdata.claim(newop.outdata);
Signature · 1 line
1.7.11.4
#1 lore raw

Hi,

Quoted 6 lines · Zheng

From: "Yan, Zheng" <[email protected]>

We need set truncate_seq when redirect the newop to CEPH_OSD_OP_WRITE, otherwise the code handles CEPH_OSD_OP_WRITE may quietly drop the data.

Applying.

This is correct, but I don't think there are any APPEND users currently in the tree. Did you run across this via inspection, or were you using this code in some other way?

Thanks!
sage

Quoted 25 lines
---
 src/osd/ReplicatedPG.cc | 1 +
 1 file changed, 1 insertion(+)
src/osd/ReplicatedPG.cc +1 -0
index f353090..fcd8be7 100644
@@ -2310,6 +2310,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
 	newop.op.op = CEPH_OSD_OP_WRITE;
 	newop.op.extent.offset = oi.size;
 	newop.op.extent.length = op.extent.length;
+	newop.op.extent.truncate_seq = oi.truncate_seq;
         newop.indata = osd_op.indata;
 	do_osd_ops(ctx, nops);
 	osd_op.outdata.claim(newop.outdata);
Signature · 6 lines
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html