summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-03-26 18:25:09 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-02 10:23:27 -0700
commit9603c9411f59fa9925361f28743fd9e44be6ad6f (patch)
tree2d828610780a9c3285feac9e5bd3b4fa23adeb17 /drivers
parentf4c96e1552f2459347f02afbfd3e2f1daf977e06 (diff)
downloadlwn-9603c9411f59fa9925361f28743fd9e44be6ad6f.tar.gz
lwn-9603c9411f59fa9925361f28743fd9e44be6ad6f.zip
USB: usb-storage: increase max_sectors for tape drives
upstream commit: 5c16034d73da2c1b663aa25dedadbc533b3d811c This patch (as1203) increases the max_sector limit for USB tape drives. By default usb-storage sets max_sectors to 240 (i.e., 120 KB) for all devices. But tape drives need a higher limit, since tapes can and do have very large block sizes. Without the ability to transfer an entire large block in a single command, such tapes can't be used. This fixes Bugzilla #12207. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: Phil Mitchell <philipm@sybase.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/storage/scsiglue.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 8daaacedfa61..5f484ae77d55 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -135,6 +135,12 @@ static int slave_configure(struct scsi_device *sdev)
if (sdev->request_queue->max_sectors > max_sectors)
blk_queue_max_sectors(sdev->request_queue,
max_sectors);
+ } else if (sdev->type == TYPE_TAPE) {
+ /* Tapes need much higher max_sector limits, so just
+ * raise it to the maximum possible (4 GB / 512) and
+ * let the queue segment size sort out the real limit.
+ */
+ blk_queue_max_sectors(sdev->request_queue, 0x7FFFFF);
}
/* We can't put these settings in slave_alloc() because that gets