From patchwork Tue Apr 5 11:56:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8750681 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 357E6C0554 for ; Tue, 5 Apr 2016 12:07:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5261520204 for ; Tue, 5 Apr 2016 12:07:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C98F2012B for ; Tue, 5 Apr 2016 12:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758264AbcDEMAF (ORCPT ); Tue, 5 Apr 2016 08:00:05 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33341 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758238AbcDEMAC (ORCPT ); Tue, 5 Apr 2016 08:00:02 -0400 Received: by mail-pa0-f65.google.com with SMTP id q6so1128546pav.0; Tue, 05 Apr 2016 05:00:01 -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=4wEqxZ/xvnN7n0/C8h7AJ9XzUJTNWhuYLzgCTM/la54=; b=WMU4KYVJKPbxYjeQPcSYjW7xQiO/V5casoEdHjSTymUyOP/iBYG3M8KwkKsPKAZyYS VDc0sCd6tg6UtinGNdiI02igBGKTC7cU3xB+qEGEBNPrHZHCfAt7j2oxWDvpBuZi0yZQ wSGnC/ZIg0GFtxJerprtLm7Ww5/ylo3um5M+5DKKrlXTdqiYxQ22BFTDQbvXFGt6ZJPg w7R/C2l7JW1E3Pq/N7dmy93rb6+flqssUn9J/5OM/jOYi8Grpk7x4VM0lmu1LLOa1E8p DdtHV1j+CzK7T1WpxLTWNaygn5dTtlqRUQ5QpIbdLW6WY2NCVKlSbDuaQNegO7wxdeii TD9A== 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=4wEqxZ/xvnN7n0/C8h7AJ9XzUJTNWhuYLzgCTM/la54=; b=M+2N610fac68oer+vZcYHqAbshqiwXx9xw6liX93pi0p5htrqcLE75T2bvVtsq0Hp2 S6EOV4pChAAKFpzDF/U8yo6Eu9FSRaQt5ubJhbONfcbbv12/8GZeaNZ3qo+EpnP2xI1b Nc56cgB7b/J3H6hQ0v6L1jylCP6MZIqgSx5TrBDRca8QbMXXDVIXOVCiTiPhIi8062ib xA7oxjac6O5yHQJbq8xXsilghdc/xknH5vkiiO7ZzpSeB8QB3rQJ4a+nZFzvP+43qkky bcYf/KRbe90zU8BmoKe0pzf4RvKp4Fhyy5hNvlyNVQNTpnqhN8e0UCa2AzJQvuCz2Ti1 c72Q== X-Gm-Message-State: AD7BkJIbWmF2GMVt0nYZ8BC2ar3wUMzKtrm887+I6ujAG3JlL3HXOoS7ExbWKnPc7rxlWw== X-Received: by 10.66.190.229 with SMTP id gt5mr61790056pac.118.1459857601441; Tue, 05 Apr 2016 05:00:01 -0700 (PDT) Received: from localhost (56.34.213.162.lcy-01.canonistack.canonical.com. [162.213.34.56]) by smtp.gmail.com with ESMTPSA id q72sm46475171pfa.70.2016.04.05.04.59.59 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 05 Apr 2016 05:00:00 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Boaz Harrosh , Ming Lei , Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , "John L. Hammond" , Frank Zago , Mike Rapoport , James Simmons , Kent Overstreet , Julia Lawall , Al Viro , lustre-devel@lists.lustre.org (moderated list:STAGING - LUSTRE PARALLEL FILESYSTEM), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) Subject: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Date: Tue, 5 Apr 2016 19:56:53 +0800 Message-Id: <1459857443-20611-9-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459857443-20611-1-git-send-email-tom.leiming@gmail.com> References: <1459857443-20611-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Signed-off-by: Ming Lei Acked-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/lloop.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c index b725fc1..67323db 100644 --- a/drivers/staging/lustre/lustre/llite/lloop.c +++ b/drivers/staging/lustre/lustre/llite/lloop.c @@ -302,19 +302,20 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req) } /* TODO: need to split the bio, too bad. */ - LASSERT(first->bi_vcnt <= LLOOP_MAX_SEGMENTS); + LASSERT(bio_pages(first) <= LLOOP_MAX_SEGMENTS); rw = first->bi_rw; bio = &lo->lo_bio; while (*bio && (*bio)->bi_rw == rw) { + unsigned curr_cnt = bio_pages(*bio); CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u\n", (unsigned long long)(*bio)->bi_iter.bi_sector, (*bio)->bi_iter.bi_size, - page_count, (*bio)->bi_vcnt); - if (page_count + (*bio)->bi_vcnt > LLOOP_MAX_SEGMENTS) + page_count, curr_cnt); + if (page_count + curr_cnt > LLOOP_MAX_SEGMENTS) break; - page_count += (*bio)->bi_vcnt; + page_count += curr_cnt; count++; bio = &(*bio)->bi_next; }