[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180402134740.GB28945@localhost.localdomain>
Date: Mon, 2 Apr 2018 07:47:40 -0600
From: Keith Busch <keith.busch@...el.com>
To: "Rodrigo R. Galvao" <rosattig@...ux.vnet.ibm.com>
Cc: hch@....de, sagi@...mberg.me, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function
On Fri, Mar 30, 2018 at 06:18:50PM -0300, Rodrigo R. Galvao wrote:
> sector = le64_to_cpu(write_zeroes->slba) <<
> (req->ns->blksize_shift - 9);
> nr_sector = (((sector_t)le16_to_cpu(write_zeroes->length)) <<
> - (req->ns->blksize_shift - 9)) + 1;
> + (req->ns->blksize_shift - 9));
I see what's wrong here. The +1 needs to be on the native format prior
to converting to 512b, so the fix needs to be:
---
sector = le64_to_cpu(write_zeroes->slba) <<
(req->ns->blksize_shift - 9);
- nr_sector = (((sector_t)le16_to_cpu(write_zeroes->length)) <<
- (req->ns->blksize_shift - 9)) + 1;
+ nr_sector = (((sector_t)le16_to_cpu(write_zeroes->length + 1)) <<
+ (req->ns->blksize_shift - 9));
if (__blkdev_issue_zeroout(req->ns->bdev, sector, nr_sector,
GFP_KERNEL, &bio, 0))
--
Powered by blists - more mailing lists