From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH 11/15] libnvdimm: pmem, blk, and btt make_request cleanups Date: Sun, 21 Jun 2015 06:26:23 -0700 Message-ID: References: <20150617235209.12943.24419.stgit@dwillia2-desk3.amr.corp.intel.com> <20150617235546.12943.2374.stgit@dwillia2-desk3.amr.corp.intel.com> <20150621101055.GD5915@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Jens Axboe , "linux-nvdimm@lists.01.org" , Boaz Harrosh , "Kani, Toshimitsu" , Vishal Verma , "linux-kernel@vger.kernel.org" , Linux ACPI , linux-fsdevel , Ingo Molnar To: Christoph Hellwig Return-path: In-Reply-To: <20150621101055.GD5915@lst.de> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, Jun 21, 2015 at 3:10 AM, Christoph Hellwig wrote: > One patch per driver please. > >> diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c >> index 8a6345797a71..9d609ef95266 100644 >> --- a/drivers/nvdimm/blk.c >> +++ b/drivers/nvdimm/blk.c >> @@ -170,18 +170,12 @@ static void nd_blk_make_request(struct request_queue *q, struct bio *bio) >> struct bvec_iter iter; >> struct bio_vec bvec; >> int err = 0, rw; >> - sector_t sector; >> >> - sector = bio->bi_iter.bi_sector; >> - if (bio_end_sector(bio) > get_capacity(disk)) { >> + if (unlikely(bio_end_sector(bio) > get_capacity(disk))) { >> err = -EIO; >> goto out; >> } >> >> - BUG_ON(bio->bi_rw & REQ_DISCARD); > > If you remove the DISCARD check you can kill the max sectors one > as well, given that generic_make_request_checks() takes care of it. Ah, true, will add that with the split. -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in