Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Two current fixes:

- one affects Qemu CD ROM emulation, which stopped working after the
updates in SCSI to require VPD pages from all conformant devices.

Fix temporarily by blacklisting Qemu (we can relax later when they
come into compliance).

- The other is a fix to the optimal transfer size. We set up a
minefield for ourselves by being confused about whether the limits
are in bytes or sectors (SCSI optimal is in blocks and the queue
parameter is in bytes).

This tries to fix the problem (wrong setting for queue limits
max_sectors) and make the problem more obvious by introducing a
wrapper function"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
sd: Fix rw_max for devices that report an optimal xfer size
scsi: Add QEMU CD-ROM to VPD Inquiry Blacklist

+10 -4
+1
drivers/scsi/scsi_devinfo.c
··· 230 230 {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 231 231 {"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC}, 232 232 {"Promise", "", NULL, BLIST_SPARSELUN}, 233 + {"QEMU", "QEMU CD-ROM", NULL, BLIST_SKIP_VPD_PAGES}, 233 234 {"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024}, 234 235 {"SYNOLOGY", "iSCSI Storage", NULL, BLIST_MAX_1024}, 235 236 {"QUANTUM", "XP34301", "1071", BLIST_NOTQ},
+4 -4
drivers/scsi/sd.c
··· 2867 2867 if (sdkp->opt_xfer_blocks && 2868 2868 sdkp->opt_xfer_blocks <= dev_max && 2869 2869 sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS && 2870 - sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE) 2871 - rw_max = q->limits.io_opt = 2872 - sdkp->opt_xfer_blocks * sdp->sector_size; 2873 - else 2870 + logical_to_bytes(sdp, sdkp->opt_xfer_blocks) >= PAGE_SIZE) { 2871 + q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); 2872 + rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); 2873 + } else 2874 2874 rw_max = BLK_DEF_MAX_SECTORS; 2875 2875 2876 2876 /* Combine with controller limits */
+5
drivers/scsi/sd.h
··· 151 151 return blocks << (ilog2(sdev->sector_size) - 9); 152 152 } 153 153 154 + static inline unsigned int logical_to_bytes(struct scsi_device *sdev, sector_t blocks) 155 + { 156 + return blocks * sdev->sector_size; 157 + } 158 + 154 159 /* 155 160 * A DIF-capable target device can be formatted with different 156 161 * protection schemes. Currently 0 through 3 are defined: