osd/ReplicatedPG: set truncate_seq when handling CEPH_OSD_OP_APPEND
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.
Signed-off-by Yan, Zheng <[email protected]>
--- src/osd/ReplicatedPG.cc | 1 + 1 file changed, 1 insertion(+)
src/osd/ReplicatedPG.cc +1 -0
@@ -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
Hi,
Quoted 6 lines · Zheng
From: "Yan, Zheng" <[email protected]>
We need set
truncate_seqwhen redirect the newop toCEPH_OSD_OP_WRITE, otherwise the code handlesCEPH_OSD_OP_WRITEmay quietly drop the data.Signed-off-by Yan, Zheng <[email protected]>
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@@ -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