Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758763AbcDENC0 (ORCPT ); Tue, 5 Apr 2016 09:02:26 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:56561 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756830AbcDENCY (ORCPT ); Tue, 5 Apr 2016 09:02:24 -0400 Date: Tue, 5 Apr 2016 06:02:23 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig , Boaz Harrosh , "Nicholas A. Bellinger" , "open list:TARGET SUBSYSTEM" , "open list:TARGET SUBSYSTEM" Subject: Re: [PATCH 09/27] target: use bio_is_full() Message-ID: <20160405130223.GC32576@infradead.org> References: <1459857443-20611-1-git-send-email-tom.leiming@gmail.com> <1459857443-20611-10-git-send-email-tom.leiming@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1459857443-20611-10-git-send-email-tom.leiming@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 568 Lines: 14 On Tue, Apr 05, 2016 at 07:56:54PM +0800, Ming Lei wrote: > +++ b/drivers/target/target_core_pscsi.c > @@ -951,7 +951,7 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, > pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n", > bio->bi_vcnt, nr_vecs); > > - if (bio->bi_vcnt > nr_vecs) { > + if (bio_is_full(bio)) { > pr_debug("PSCSI: Reached bio->bi_vcnt max:" > " %d i: %d bio: %p, allocating another" > " bio\n", bio->bi_vcnt, i, bio); This check should be removed entirely - bio_add_pc_page takes care of it.