linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH 2/4] scsi_debug: fix logical block provisioning support when unmap_alignment != 0
Date: Tue, 20 Aug 2013 16:56:40 -0400	[thread overview]
Message-ID: <5213D808.1080806@interlog.com> (raw)
In-Reply-To: <CAC5umyh8+zBtKrpoFXdO+1D_5vOQS-P82LkocmaVY+FXb5YHRA@mail.gmail.com>

On 13-08-19 10:16 AM, Akinobu Mita wrote:
> Hi Douglas, Martin,
>
> Could you review this patch when you have a time?  I would like to
> submit at least this patch 2/4, and 1/4 which has already been acked
> by Douglas for the next merge window.
>
> Although the patches 2/4 ~ 4/4 are all related to the logical block
> provisioning support, the problems that fixed by 3/4 and 4/4 only
> happen with virtual_gb option enabled, too.  On the other hand, the
> problem that fixed by 2/4 is easily reproduced by, for example,
> 'modprobe scsi_debug lbpu=1 unmap_alignment=1 unmap_granularity=4'.
> So the patch 2/4 has rather higher severity than others.

This is Martin's area of expertise so I hope he also
acks it.

Acked-by: Douglas Gilbert <dgilbert@interlog.com>

> 2013/7/15 Akinobu Mita <akinobu.mita@gmail.com>:
>> Commit b90ebc3d5c41c9164ae04efd2e4f8204c2a186f1 ("[SCSI] scsi_debug:
>> fix logical block provisioning support") fixed several issues with
>> logical block provisioning support, but it still doesn't properly fix
>> the cases when unmap_alignment > 0.  (for example, unmap_alignment=1
>> and unmap_granularity=3)
>>
>> The problem is in map_index_to_lba(), which should return the first
>> LBA which is corresponding to a given index of provisioning map
>> (map_storep).
>>
>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
>> Cc: Douglas Gilbert <dgilbert@interlog.com>
>> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
>> Cc: linux-scsi@vger.kernel.org
>> ---
>>   drivers/scsi/scsi_debug.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
>> index 2f39b13..01c0ffa 100644
>> --- a/drivers/scsi/scsi_debug.c
>> +++ b/drivers/scsi/scsi_debug.c
>> @@ -1997,8 +1997,14 @@ static unsigned long lba_to_map_index(sector_t lba)
>>
>>   static sector_t map_index_to_lba(unsigned long index)
>>   {
>> -       return index * scsi_debug_unmap_granularity -
>> -               scsi_debug_unmap_alignment;
>> +       sector_t lba = index * scsi_debug_unmap_granularity;
>> +
>> +       if (scsi_debug_unmap_alignment) {
>> +               lba -= scsi_debug_unmap_granularity -
>> +                       scsi_debug_unmap_alignment;
>> +       }
>> +
>> +       return lba;
>>   }
>>
>>   static unsigned int map_state(sector_t lba, unsigned int *num)
>> --
>> 1.8.3.1
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


  reply	other threads:[~2013-08-20 20:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 11:52 [PATCH 0/4] scsi_debug: fix bugs with certain module parameters Akinobu Mita
2013-07-15 11:52 ` [PATCH 1/4] scsi_debug: fix endianness bug in sdebug_build_parts() Akinobu Mita
2013-07-25 17:10   ` Martin Peschke
2013-07-25 20:16     ` Douglas Gilbert
2013-07-26 17:07     ` Akinobu Mita
2013-07-29 10:53       ` Martin Peschke
2013-07-15 11:52 ` [PATCH 2/4] scsi_debug: fix logical block provisioning support when unmap_alignment != 0 Akinobu Mita
2013-08-19 14:16   ` Akinobu Mita
2013-08-20 20:56     ` Douglas Gilbert [this message]
2013-08-21 13:58       ` Akinobu Mita
2013-08-22  1:29       ` Martin K. Petersen
2013-07-15 11:52 ` [PATCH 3/4] scsi_debug: fix WRITE_SAME with virtual_gb > 0 Akinobu Mita
2013-07-15 11:52 ` [PATCH 4/4] scsi_debug: fix out of range access by Get_LBA_status " Akinobu Mita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5213D808.1080806@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=JBottomley@parallels.com \
    --cc=akinobu.mita@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).