From patchwork Sat Oct 29 08:08:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9405173 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B4E46022E for ; Mon, 31 Oct 2016 09:01:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 335E02928D for ; Mon, 31 Oct 2016 09:01:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27D3D2928F; Mon, 31 Oct 2016 09:01:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C89D52928D for ; Mon, 31 Oct 2016 09:01:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9V8x4BY007810; Mon, 31 Oct 2016 04:59:04 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9T8CdMF026581 for ; Sat, 29 Oct 2016 04:12:39 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9T8CdqD017332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 29 Oct 2016 04:12:39 -0400 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB331C057FA5; Sat, 29 Oct 2016 08:12:38 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id u84so3375173pfj.1; Sat, 29 Oct 2016 01:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4gsn2gVuYkeMNKTx3BUW6t0pvns2OxZYqp9yXTD5xJ8=; b=Z+82GVmxGlxR/BH3FDSvh60O4v2arlC7BANVqK/ih/bDaCMSn1SKQ/12/RyUXYqzFn v9T9dsd73uasRf/CFpmwgg5pA3DKncvUIOIuyGL1ovlq+QuIIWXTK1h8PGUlYaqkQCFb nrWi9gpkyiCy09FUEj7HCl7yhH3ZljxeRTyWbi+urrFeqEVgNia3iEIgrVacNlx/fnjc p73mHIsxzYZIslLHvParfYfoZLqmi4lGUCvJJVHd3ZmOdWyBczjbxBiAJ5UQQfURG/fU lbV3KmMfGyhjWaHb1D3Ov9EPkpT6QbZ0uXjMvn68KcDr25GUrY81jXQ21kKCKXFFo3EY YlvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4gsn2gVuYkeMNKTx3BUW6t0pvns2OxZYqp9yXTD5xJ8=; b=ii0t/6joMvapdjZ2Hmk1HzpThnfYNw/0KXA3mL706jYwc0CW8il4i306GvUNUBiimI URqH0wG6AgKbplgMM+KeRrm3TMzUs6ZuwZJW/Y90b5cgQji3Oq+r9RvTzaRL+S3jcWD9 qDBca1lWsF20d83309NAkc+WPEyXxLHW+v+FAy9hAskvLV30QXGSU7WMuCadfOi/mPWN wJk/6coxIBSkvhiYHT4oN+IQTmDB25AZIxIKMctklcaQxV5vFDH9QwnusCmby8UJOAS/ 31itFDYs1Egp7Pr+zyvOkCT9aWvNzzBtaX5T6wigeE+FHHbn6X6R2Hir+4Z3YWo+umM+ 2oqg== X-Gm-Message-State: ABUngvcoxLewldRV+0ZTfeYxKtra56SGYbdVZ7bErweaVYxJ89XSKrsxf8PXMT6aDm7QpA== X-Received: by 10.98.97.71 with SMTP id v68mr31724081pfb.133.1477728758334; Sat, 29 Oct 2016 01:12:38 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id dj3sm23581025pad.1.2016.10.29.01.12.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:12:37 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Date: Sat, 29 Oct 2016 16:08:08 +0800 Message-Id: <1477728600-12938-10-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> References: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 29 Oct 2016 08:12:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 29 Oct 2016 08:12:38 +0000 (UTC) for IP:'209.85.192.196' DOMAIN:'mail-pf0-f196.google.com' HELO:'mail-pf0-f196.google.com' FROM:'tom.leiming@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.192.196 mail-pf0-f196.google.com 209.85.192.196 mail-pf0-f196.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 31 Oct 2016 04:58:15 -0400 Cc: Christoph Hellwig , Mike Snitzer , Ming Lei , linux-block@vger.kernel.org, "maintainer:DEVICE-MAPPER LVM, Shaohua Li , linux-raid@vger.kernel.org open list:SOFTWARE RAID Multiple DisksSUPPORT" , "Kirill A . Shutemov" , linux-fsdevel@vger.kernel.org, Alasdair Kergon Subject: [dm-devel] [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP Avoid to access .bi_vcnt directly, because it may be not what the driver expected any more after supporting multipage bvec. Signed-off-by: Ming Lei --- drivers/md/dm-rq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 1d0d2adc050a..8534cbf8ce35 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -819,7 +819,8 @@ static void dm_old_request_fn(struct request_queue *q) pos = blk_rq_pos(rq); if ((dm_old_request_peeked_before_merge_deadline(md) && - md_in_flight(md) && rq->bio && rq->bio->bi_vcnt == 1 && + md_in_flight(md) && rq->bio && + !bio_multiple_segments(rq->bio) && md->last_rq_pos == pos && md->last_rq_rw == rq_data_dir(rq)) || (ti->type->busy && ti->type->busy(ti))) { blk_delay_queue(q, 10);