LKML Archive on
help / color / mirror / Atom feed
* [GIT PULL] SCSI fixes for 3.19-rc7
@ 2015-02-05 17:53 James Bottomley
  0 siblings, 0 replies; only message in thread
From: James Bottomley @ 2015-02-05 17:53 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: linux-scsi, linux-kernel

This patch set is fixing two serious problems which have turned up late
in the release cycle.  The first fixes a problem with 4k sector disks
where the transfer length (amount of data sent to the disk) was getting
increased every time the disk was revalidated leading to potential for
overflows.  The other is a regression oops fix for some of our last
merge window code.

The patch is available here:

git:// scsi-fixes

The short changelog is:

Brian King (1):
      sd: Fix max transfer length for 4k disks

Mike Christie (1):
      scsi: fix device handler detach oops

And the diffstat

 drivers/scsi/device_handler/scsi_dh.c | 3 ++-
 drivers/scsi/sd.c                     | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

With the full diff below.



diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
index 1dba62c..1efebc9 100644
--- a/drivers/scsi/device_handler/scsi_dh.c
+++ b/drivers/scsi/device_handler/scsi_dh.c
@@ -136,11 +136,12 @@ static void __detach_handler (struct kref *kref)
 	struct scsi_device_handler *scsi_dh = scsi_dh_data->scsi_dh;
 	struct scsi_device *sdev = scsi_dh_data->sdev;
+	scsi_dh->detach(sdev);
 	sdev->scsi_dh_data = NULL;
-	scsi_dh->detach(sdev);
 	sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", scsi_dh->name);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3995169..05ea0d4 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2800,9 +2800,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
-	max_xfer = min_not_zero(queue_max_hw_sectors(sdkp->disk->queue),
-				sdkp->max_xfer_blocks);
+	max_xfer = sdkp->max_xfer_blocks;
 	max_xfer <<= ilog2(sdp->sector_size) - 9;
+	max_xfer = min_not_zero(queue_max_hw_sectors(sdkp->disk->queue),
+				max_xfer);
 	blk_queue_max_hw_sectors(sdkp->disk->queue, max_xfer);
 	set_capacity(disk, sdkp->capacity);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-05 17:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 17:53 [GIT PULL] SCSI fixes for 3.19-rc7 James Bottomley

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).