linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lightnvm: pblk: remove size and out of bounds read check
@ 2018-08-20 12:59 Matias Bjørling
  2018-08-20 13:31 ` Javier Gonzalez
  0 siblings, 1 reply; 2+ messages in thread
From: Matias Bjørling @ 2018-08-20 12:59 UTC (permalink / raw)
  To: igor.j.konopko, marcin.dziegielewski, javier, hans.holmberg,
	hlitz, youngtack.jin
  Cc: linux-block, linux-kernel, Matias Bjørling

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lightnvm: pblk: remove size and out of bounds read check
  2018-08-20 12:59 [PATCH] lightnvm: pblk: remove size and out of bounds read check Matias Bjørling
@ 2018-08-20 13:31 ` Javier Gonzalez
  0 siblings, 0 replies; 2+ messages in thread
From: Javier Gonzalez @ 2018-08-20 13:31 UTC (permalink / raw)
  To: Matias Bjørling
  Cc: Konopko, Igor J, marcin.dziegielewski, Hans Holmberg,
	Heiner Litz, Young Tack Tack Jin, linux-block, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

> 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>


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-20 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-20 12:59 [PATCH] lightnvm: pblk: remove size and out of bounds read check Matias Bjørling
2018-08-20 13:31 ` Javier Gonzalez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).