linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	Douglas Gilbert <dgilbert@interlog.com>
Subject: Re: [PATCH 1/4] scsi_debug: fix endianness bug in sdebug_build_parts()
Date: Sat, 27 Jul 2013 02:07:41 +0900	[thread overview]
Message-ID: <CAC5umyi8LkZ1kETSpbDNSu2YaAJRXf6Ag0VYCPdFs4zD2hqeKQ@mail.gmail.com> (raw)
In-Reply-To: <1374772228.15813.3.camel@br9vgx5g.de.ibm.com>

2013/7/26 Martin Peschke <mpeschke@linux.vnet.ibm.com>:
> On Mon, 2013-07-15 at 20:52 +0900, Akinobu Mita wrote:
>> With module parameter num_parts > 0, partition table is built on the
>> ramdisk storage when loading the driver.  Unfortunately, there is an
>> endianness bug in sdebug_build_parts().  So the partition table is not
>> correctly initialized on big-endian systems.
>>
>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
>> Cc: Douglas Gilbert <dgilbert@interlog.com>
>> Cc: linux-scsi@vger.kernel.org
>> ---
>>  drivers/scsi/scsi_debug.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
>> index cb4fefa..2f39b13 100644
>> --- a/drivers/scsi/scsi_debug.c
>> +++ b/drivers/scsi/scsi_debug.c
>> @@ -2659,8 +2659,8 @@ static void __init sdebug_build_parts(unsigned char *ramp,
>>                              / sdebug_sectors_per;
>>               pp->end_sector = (end_sec % sdebug_sectors_per) + 1;
>>
>> -             pp->start_sect = start_sec;
>> -             pp->nr_sects = end_sec - start_sec + 1;
>> +             pp->start_sect = cpu_to_le32(start_sec);
>> +             pp->nr_sects = cpu_to_le32(end_sec - start_sec + 1);
>>               pp->sys_ind = 0x83;     /* plain Linux partition */
>>       }
>>  }
>
>
> I have posted the same fix several times, e.g.
> http://marc.info/?l=linux-scsi&m=137051617907423&w=2
> Good luck!
>
> Acked-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>

Thanks.  I found this problem from sparse warning noticed by 0-DAY kernel
build testing.

  parent reply	other threads:[~2013-07-26 17:07 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 [this message]
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
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=CAC5umyi8LkZ1kETSpbDNSu2YaAJRXf6Ag0VYCPdFs4zD2hqeKQ@mail.gmail.com \
    --to=akinobu.mita@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mpeschke@linux.vnet.ibm.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).