aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-12 17:34:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-12 17:34:11 -0400
commitde72aa4c2b82a6cffe15d86a8d391ded4fb57602 (patch)
treeaac3f09c8e1e2154e532886d0196a46386af301a
parent536abdb0802f3fac1b217530741853843d63c281 (diff)
parent8df5fc042c8e7c08dc438c8198b62407ee1e91a0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] bsg: fix oops on remove [SCSI] fusion: default MSI to disabled for SPI and FC controllers [SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices [SCSI] mptspi: fix oops in mptspi_dv_renegotiate_work() [SCSI] erase invalid data returned by device
-rw-r--r--block/bsg.c3
-rw-r--r--drivers/message/fusion/mptbase.c11
-rw-r--r--drivers/message/fusion/mptspi.c9
-rw-r--r--drivers/scsi/ipr.c6
-rw-r--r--drivers/scsi/scsi_lib.c9
5 files changed, 31 insertions, 7 deletions
diff --git a/block/bsg.c b/block/bsg.c
index f0b7cd34321..54d617f7df3 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -709,11 +709,12 @@ static void bsg_kref_release_function(struct kref *kref)
709{ 709{
710 struct bsg_class_device *bcd = 710 struct bsg_class_device *bcd =
711 container_of(kref, struct bsg_class_device, ref); 711 container_of(kref, struct bsg_class_device, ref);
712 struct device *parent = bcd->parent;
712 713
713 if (bcd->release) 714 if (bcd->release)
714 bcd->release(bcd->parent); 715 bcd->release(bcd->parent);
715 716
716 put_device(bcd->parent); 717 put_device(parent);
717} 718}
718 719
719static int bsg_put_device(struct bsg_device *bd) 720static int bsg_put_device(struct bsg_device *bd)
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index db3c892f87f..d40d6d15ae2 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1686,9 +1686,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1686 ioc->bus_type = SAS; 1686 ioc->bus_type = SAS;
1687 } 1687 }
1688 1688
1689 if (ioc->bus_type == SAS && mpt_msi_enable == -1) 1689 if (mpt_msi_enable == -1) {
1690 ioc->msi_enable = 1; 1690 /* Enable on SAS, disable on FC and SPI */
1691 else 1691 if (ioc->bus_type == SAS)
1692 ioc->msi_enable = 1;
1693 else
1694 ioc->msi_enable = 0;
1695 } else
1696 /* follow flag: 0 - disable; 1 - enable */
1692 ioc->msi_enable = mpt_msi_enable; 1697 ioc->msi_enable = mpt_msi_enable;
1693 1698
1694 if (ioc->errata_flag_1064) 1699 if (ioc->errata_flag_1064)
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 25bcfcf36f2..1effca4e40e 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1266,13 +1266,18 @@ mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd)
1266static int 1266static int
1267mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) 1267mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
1268{ 1268{
1269 struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh);
1270 int rc; 1269 int rc;
1271 1270
1272 rc = mptscsih_ioc_reset(ioc, reset_phase); 1271 rc = mptscsih_ioc_reset(ioc, reset_phase);
1273 1272
1274 if (reset_phase == MPT_IOC_POST_RESET) 1273 /* only try to do a renegotiation if we're properly set up
1274 * if we get an ioc fault on bringup, ioc->sh will be NULL */
1275 if (reset_phase == MPT_IOC_POST_RESET &&
1276 ioc->sh) {
1277 struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh);
1278
1275 mptspi_dv_renegotiate(hd); 1279 mptspi_dv_renegotiate(hd);
1280 }
1276 1281
1277 return rc; 1282 return rc;
1278} 1283}
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 999e91ea745..e7a3a655442 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -71,6 +71,7 @@
71#include <linux/module.h> 71#include <linux/module.h>
72#include <linux/moduleparam.h> 72#include <linux/moduleparam.h>
73#include <linux/libata.h> 73#include <linux/libata.h>
74#include <linux/hdreg.h>
74#include <asm/io.h> 75#include <asm/io.h>
75#include <asm/irq.h> 76#include <asm/irq.h>
76#include <asm/processor.h> 77#include <asm/processor.h>
@@ -4913,8 +4914,11 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
4913 struct ipr_resource_entry *res; 4914 struct ipr_resource_entry *res;
4914 4915
4915 res = (struct ipr_resource_entry *)sdev->hostdata; 4916 res = (struct ipr_resource_entry *)sdev->hostdata;
4916 if (res && ipr_is_gata(res)) 4917 if (res && ipr_is_gata(res)) {
4918 if (cmd == HDIO_GET_IDENTITY)
4919 return -ENOTTY;
4917 return ata_scsi_ioctl(sdev, cmd, arg); 4920 return ata_scsi_ioctl(sdev, cmd, arg);
4921 }
4918 4922
4919 return -EINVAL; 4923 return -EINVAL;
4920} 4924}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index a82d2fe80fb..cbf55d59a54 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -207,6 +207,15 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
207 */ 207 */
208 blk_execute_rq(req->q, NULL, req, 1); 208 blk_execute_rq(req->q, NULL, req, 1);
209 209
210 /*
211 * Some devices (USB mass-storage in particular) may transfer
212 * garbage data together with a residue indicating that the data
213 * is invalid. Prevent the garbage from being misinterpreted
214 * and prevent security leaks by zeroing out the excess data.
215 */
216 if (unlikely(req->data_len > 0 && req->data_len <= bufflen))
217 memset(buffer + (bufflen - req->data_len), 0, req->data_len);
218
210 ret = req->errors; 219 ret = req->errors;
211 out: 220 out:
212 blk_put_request(req); 221 blk_put_request(req);