Re: [PATCH] scsi_debug: Fix endianess in partition table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2013-02-12 at 09:45 -0500, Douglas Gilbert wrote:
> However since SCSI is big endian and you are introducing
> some "le" code then a line or so of explanation (comments)
> in your revised patch might be helpful.

I would argue that the definition of struct partition itself should be
sufficient explanation. Only scsi_debug failed to assign values in a
correct manner. 

> BTW Finding a big endian architecture to test this patch on is
> not easy.

No big deal ;-) I can help out with test data from my System z (aka
s390x).


Without fix:

[root@zzzzzzzz ~]# xxd -l 512 /dev/sda
<snip>
00001b0: 0000 0000 0000 0000 0000 0000 0000 0001  ................
00001c0: 0100 8307 203f 0000 0020 0000 3fe0 0000  .... ?... ..?...
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.


With fix:

[root@zzzzzzzz ~]# xxd -l 512 /dev/sda
<snip>
00001b0: 0000 0000 0000 0000 0000 0000 0000 0001  ................
00001c0: 0100 8307 203f 2000 0000 e03f 0000 0000  .... ? ....?....
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.


Which makes it exactly look like the table seen on my laptop:

root@xxxxxxxx:~# xxd -l 512 /dev/sdb
<snip>
00001b0: 0000 0000 0000 0000 0000 0000 0000 0001  ................
00001c0: 0100 8307 203f 2000 0000 e03f 0000 0000  .... ? ....?....
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.


Assuming:
modprobe scsi_debug physblk_exp=3 lowest_aligned=7 num_parts=1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux