Skip to content

Commit

Permalink
[SCSI] scsi_debug: fix endianness bug in sdebug_build_parts()
Browse files Browse the repository at this point in the history
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>
Tested-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Akinobu Mita authored and James Bottomley committed Sep 3, 2013
1 parent e03d1b2 commit 150c354
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
}
Expand Down

0 comments on commit 150c354

Please sign in to comment.