From patchwork Mon Nov 24 09:59:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 5364441 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22CA8C11AC for ; Mon, 24 Nov 2014 10:00:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50C402037B for ; Mon, 24 Nov 2014 10:00:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F6A420373 for ; Mon, 24 Nov 2014 10:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbaKXKAD (ORCPT ); Mon, 24 Nov 2014 05:00:03 -0500 Received: from mail-la0-f45.google.com ([209.85.215.45]:41543 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbaKXKAC (ORCPT ); Mon, 24 Nov 2014 05:00:02 -0500 Received: by mail-la0-f45.google.com with SMTP id gq15so7306763lab.32 for ; Mon, 24 Nov 2014 02:00:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=g8XW50+b8BPZ0H8PX97eqd9dCI6xSXu5CJojeM9dCYY=; b=KWxfciNWO2t/hIudRC3CWRG8vtTc+ehdK7XrHXwucO89W/2vfmgwkhE19CVJ17k0/7 1ph2Kl3/X064Ad6k7LuaYWZlljHKxDiTe2xM/d9CARkVicxNyrM6wgOCAbX80JVCP3Tq tcL8vXGMR0ef8wisUC5iP8jjZrDIEkOtWkrf3AOZY2yLYtqFummWdel2VSzKeaLmUeuI vthTFTmkNisOtuVHFRPjWYLwRc+nNb4P33RwHJLBajRZbX30La6B/+p99RMzphSj0W63 5eTdt+riY7mV4Y+wUybBZkOZ0uAJoRjRD3TXsyC+McRM7DpbnTv/tOK4/isMr8TQg599 Zryw== X-Gm-Message-State: ALoCoQlIw5NmF2Dua+NhoApIWMCljesN6D8B8kbzfHyxKKW0MlZgf2GwN6OSNppaBeiYrE0UW6Mf X-Received: by 10.152.1.130 with SMTP id 2mr18393643lam.89.1416823200160; Mon, 24 Nov 2014 02:00:00 -0800 (PST) Received: from localhost ([109.110.66.84]) by mx.google.com with ESMTPSA id vr7sm3425856lbb.21.2014.11.24.01.59.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 24 Nov 2014 01:59:59 -0800 (PST) From: Ilya Dryomov X-Google-Original-From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH] rbd: don't treat CEPH_OSD_OP_DELETE as extent op Date: Mon, 24 Nov 2014 12:59:50 +0300 Message-Id: <1416823190-10246-1-git-send-email-idryomov@redhat.com> X-Mailer: git-send-email 2.1.1 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CEPH_OSD_OP_DELETE is not an extent op, stop treating it as such. This sneaked in with discard patches - it's one of the three osd ops (the other two are CEPH_OSD_OP_TRUNCATE and CEPH_OSD_OP_ZERO) that discard is implemented with. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- drivers/block/rbd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 27b71a0b72d0..1df0802bf6cb 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2370,8 +2370,12 @@ static void rbd_img_obj_request_fill(struct rbd_obj_request *obj_request, opcode = CEPH_OSD_OP_READ; } - osd_req_op_extent_init(osd_request, num_ops, opcode, offset, length, - 0, 0); + if (opcode == CEPH_OSD_OP_DELETE) + osd_req_op_init(osd_request, num_ops, opcode); + else + osd_req_op_extent_init(osd_request, num_ops, opcode, + offset, length, 0, 0); + if (obj_request->type == OBJ_REQUEST_BIO) osd_req_op_extent_osd_data_bio(osd_request, num_ops, obj_request->bio_list, length);