From patchwork Tue Sep 11 03:15:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1434861 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A9C424025E for ; Tue, 11 Sep 2012 03:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754916Ab2IKDP3 (ORCPT ); Mon, 10 Sep 2012 23:15:29 -0400 Received: from mga01.intel.com ([192.55.52.88]:63028 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754884Ab2IKDP3 (ORCPT ); Mon, 10 Sep 2012 23:15:29 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Sep 2012 20:15:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,401,1344236400"; d="scan'208";a="220535374" Received: from fhe5-mobl.ccr.corp.intel.com (HELO zyan5-mobl.sh.intel.com) ([10.239.36.111]) by fmsmga001.fm.intel.com with ESMTP; 10 Sep 2012 20:15:27 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: "Yan, Zheng" Subject: [PATCH] osd/ReplicatedPG: set truncate_seq when handling CEPH_OSD_OP_APPEND Date: Tue, 11 Sep 2012 11:15:26 +0800 Message-Id: <1347333326-6392-1-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" 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 --- 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& 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);