Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Rodrigo Rosatti Galvao
Thanks Keith. The patch you proposed worked fine!! I just sent a V2 with that change! On 04/02/2018 11:21 AM, Keith Busch wrote: On Mon, Apr 02, 2018 at 10:47:10AM -0300, Rodrigo Rosatti Galvao wrote: One thing that I just forgot to explain previously, but I think its relevant: 1. The

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Rodrigo Rosatti Galvao
Thanks Keith. The patch you proposed worked fine!! I just sent a V2 with that change! On 04/02/2018 11:21 AM, Keith Busch wrote: On Mon, Apr 02, 2018 at 10:47:10AM -0300, Rodrigo Rosatti Galvao wrote: One thing that I just forgot to explain previously, but I think its relevant: 1. The

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Keith Busch
On Mon, Apr 02, 2018 at 10:47:10AM -0300, Rodrigo Rosatti Galvao wrote: > One thing that I just forgot to explain previously, but I think its > relevant: > > 1. The command is failing with 4k logical block size, but works with 512B > > 2. With the patch, the command is working for both 512B and

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Keith Busch
On Mon, Apr 02, 2018 at 10:47:10AM -0300, Rodrigo Rosatti Galvao wrote: > One thing that I just forgot to explain previously, but I think its > relevant: > > 1. The command is failing with 4k logical block size, but works with 512B > > 2. With the patch, the command is working for both 512B and

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Rodrigo Rosatti Galvao
One thing that I just forgot to explain previously, but I think its relevant: 1. The command is failing with 4k logical block size, but works with 512B 2. With the patch, the command is working for both 512B and 4K. Here are some extra information I could get when executing the command with

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Rodrigo Rosatti Galvao
One thing that I just forgot to explain previously, but I think its relevant: 1. The command is failing with 4k logical block size, but works with 512B 2. With the patch, the command is working for both 512B and 4K. Here are some extra information I could get when executing the command with

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Keith Busch
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; > +

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread Keith Busch
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; > +

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread chaitany kulkarni
Please give me a couple of days, I'll look into this. On Fri, Mar 30, 2018 at 2:48 PM, Rodrigo Rosatti Galvão wrote: > >> Doesn't that mean your host is using this command wrong? The NLB is a >> 0's based value, we're supposed to +1 to get the correct block count. >

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-04-02 Thread chaitany kulkarni
Please give me a couple of days, I'll look into this. On Fri, Mar 30, 2018 at 2:48 PM, Rodrigo Rosatti Galvão wrote: > >> Doesn't that mean your host is using this command wrong? The NLB is a >> 0's based value, we're supposed to +1 to get the correct block count. > > > Keith, I tested passing

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-03-30 Thread Rodrigo Rosatti Galvão
Doesn't that mean your host is using this command wrong? The NLB is a 0's based value, we're supposed to +1 to get the correct block count. Keith, I tested passing different values to the c (number of blocks) and s (64-bit LBA of first block to access) parameters, and it was failing. When I

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-03-30 Thread Rodrigo Rosatti Galvão
Doesn't that mean your host is using this command wrong? The NLB is a 0's based value, we're supposed to +1 to get the correct block count. Keith, I tested passing different values to the c (number of blocks) and s (64-bit LBA of first block to access) parameters, and it was failing. When I

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-03-30 Thread Keith Busch
On Fri, Mar 30, 2018 at 06:18:50PM -0300, Rodrigo R. Galvao wrote: > When trying to issue write_zeroes command against TARGET the nr_sector is > being incremented by 1, which ends up hitting the following condition at > __blkdev_issue_zeroout: > > if ((sector | nr_sects) & bs_mask) >

Re: [PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-03-30 Thread Keith Busch
On Fri, Mar 30, 2018 at 06:18:50PM -0300, Rodrigo R. Galvao wrote: > When trying to issue write_zeroes command against TARGET the nr_sector is > being incremented by 1, which ends up hitting the following condition at > __blkdev_issue_zeroout: > > if ((sector | nr_sects) & bs_mask) >

[PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-03-30 Thread Rodrigo R. Galvao
When trying to issue write_zeroes command against TARGET the nr_sector is being incremented by 1, which ends up hitting the following condition at __blkdev_issue_zeroout: if ((sector | nr_sects) & bs_mask) return -EINVAL; Causing the command to always fail. Removing the

[PATCH] nvmet: fix nvmet_execute_write_zeroes function

2018-03-30 Thread Rodrigo R. Galvao
When trying to issue write_zeroes command against TARGET the nr_sector is being incremented by 1, which ends up hitting the following condition at __blkdev_issue_zeroout: if ((sector | nr_sects) & bs_mask) return -EINVAL; Causing the command to always fail. Removing the