diff mbox series

lightnvm: pblk: remove size and out of bounds read check

Message ID 20180820125953.15364-1-mb@lightnvm.io (mailing list archive)
State New, archived
Headers show
Series lightnvm: pblk: remove size and out of bounds read check | expand

Commit Message

Matias Bjorling Aug. 20, 2018, 12:59 p.m. UTC
The I/O size and capacity check are already done by the block layer.

Signed-off-by: Matias Bjørling <mb@lightnvm.io>
---
 drivers/lightnvm/pblk-read.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Javier Gonzalez Aug. 20, 2018, 1:31 p.m. UTC | #1
> On 20 Aug 2018, at 14.59, Matias Bjørling <mb@lightnvm.io> wrote:
> 
> The I/O size and capacity check are already done by the block layer.
> 
> Signed-off-by: Matias Bjørling <mb@lightnvm.io>
> ---
> drivers/lightnvm/pblk-read.c | 7 -------
> 1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c
> index f275c7e5abe4..d0fbd50ecc90 100644
> --- a/drivers/lightnvm/pblk-read.c
> +++ b/drivers/lightnvm/pblk-read.c
> @@ -452,13 +452,6 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio)
> 	DECLARE_BITMAP(read_bitmap, NVM_MAX_VLBA);
> 	int ret = NVM_IO_ERR;
> 
> -	/* logic error: lba out-of-bounds. Ignore read request */
> -	if (blba >= pblk->rl.nr_secs || nr_secs > NVM_MAX_VLBA) {
> -		WARN(1, "pblk: read lba out of bounds (lba:%llu, nr:%d)\n",
> -					(unsigned long long)blba, nr_secs);
> -		return NVM_IO_ERR;
> -	}
> -
> 	generic_start_io_acct(q, READ, bio_sectors(bio), &pblk->disk->part0);
> 
> 	bitmap_zero(read_bitmap, nr_secs);
> --
> 2.11.0


Looks good to me.

Reviewed-by: Javier González <javier@cnexlabs.com>
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c
index f275c7e5abe4..d0fbd50ecc90 100644
--- a/drivers/lightnvm/pblk-read.c
+++ b/drivers/lightnvm/pblk-read.c
@@ -452,13 +452,6 @@  int pblk_submit_read(struct pblk *pblk, struct bio *bio)
 	DECLARE_BITMAP(read_bitmap, NVM_MAX_VLBA);
 	int ret = NVM_IO_ERR;
 
-	/* logic error: lba out-of-bounds. Ignore read request */
-	if (blba >= pblk->rl.nr_secs || nr_secs > NVM_MAX_VLBA) {
-		WARN(1, "pblk: read lba out of bounds (lba:%llu, nr:%d)\n",
-					(unsigned long long)blba, nr_secs);
-		return NVM_IO_ERR;
-	}
-
 	generic_start_io_acct(q, READ, bio_sectors(bio), &pblk->disk->part0);
 
 	bitmap_zero(read_bitmap, nr_secs);