diff mbox

osd/ReplicatedPG: set truncate_seq when handling CEPH_OSD_OP_APPEND

Message ID 1347333326-6392-1-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Sept. 11, 2012, 3:15 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

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 <zheng.z.yan@intel.com>
---
 src/osd/ReplicatedPG.cc | 1 +
 1 file changed, 1 insertion(+)

Comments

Sage Weil Sept. 12, 2012, 9:12 p.m. UTC | #1
Hi,

On Tue, 11 Sep 2012, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 
> 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 <zheng.z.yan@intel.com>

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


> ---
>  src/osd/ReplicatedPG.cc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
> index f353090..fcd8be7 100644
> --- a/src/osd/ReplicatedPG.cc
> +++ b/src/osd/ReplicatedPG.cc
> @@ -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);
> -- 
> 1.7.11.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index f353090..fcd8be7 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -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);