diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 19:55:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 19:55:27 -0500 |
commit | 654451748b779b28077d9058442d0f354251870d (patch) | |
tree | ff889a2f6226e16b1121789f809927666a9ccf13 /drivers/scsi/scsi_transport_fc.c | |
parent | 64d497f55379b1e320a08ec2426468d96f5642ec (diff) | |
parent | 77c9cfc51b0d732b2524799810fb30018074fd60 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (158 commits)
[SCSI] Fix printing of failed 32-byte commands
[SCSI] Fix printing of variable length commands
[SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation
[SCSI] scsi_dh_alua: Add IBM Power Virtual SCSI ALUA device to dev list
[SCSI] scsi_dh_alua: add netapp to dev list
[SCSI] qla2xxx: Update version number to 8.03.02-k1.
[SCSI] qla2xxx: EEH: Restore PCI saved state during pci slot reset.
[SCSI] qla2xxx: Add firmware ETS burst support.
[SCSI] qla2xxx: Correct loop-resync issues during SNS scans.
[SCSI] qla2xxx: Correct use-after-free issue in terminate_rport_io callback.
[SCSI] qla2xxx: Correct EH bus-reset handling.
[SCSI] qla2xxx: Proper clean-up of BSG requests when request times out.
[SCSI] qla2xxx: Initialize payload receive length in failure path of vendor commands
[SCSI] fix duplicate removal on error path in scsi_sysfs_add_sdev
[SCSI] fix refcounting bug in scsi_get_host_dev
[SCSI] fix memory leak in scsi_report_lun_scan
[SCSI] lpfc: correct PPC build failure
[SCSI] raid_class: add raid1e
[SCSI] mpt2sas: Do not call sas_is_tlr_enabled for RAID volumes.
[SCSI] zfcp: Introduce header file for qdio structs and inline functions
...
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 653f22a8deb9..79660ee3e211 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -475,7 +475,8 @@ MODULE_PARM_DESC(dev_loss_tmo, | |||
475 | "Maximum number of seconds that the FC transport should" | 475 | "Maximum number of seconds that the FC transport should" |
476 | " insulate the loss of a remote port. Once this value is" | 476 | " insulate the loss of a remote port. Once this value is" |
477 | " exceeded, the scsi target is removed. Value should be" | 477 | " exceeded, the scsi target is removed. Value should be" |
478 | " between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT."); | 478 | " between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT if" |
479 | " fast_io_fail_tmo is not set."); | ||
479 | 480 | ||
480 | /* | 481 | /* |
481 | * Netlink Infrastructure | 482 | * Netlink Infrastructure |
@@ -842,9 +843,17 @@ store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr, | |||
842 | (rport->port_state == FC_PORTSTATE_NOTPRESENT)) | 843 | (rport->port_state == FC_PORTSTATE_NOTPRESENT)) |
843 | return -EBUSY; | 844 | return -EBUSY; |
844 | val = simple_strtoul(buf, &cp, 0); | 845 | val = simple_strtoul(buf, &cp, 0); |
845 | if ((*cp && (*cp != '\n')) || | 846 | if ((*cp && (*cp != '\n')) || (val < 0)) |
846 | (val < 0) || (val > SCSI_DEVICE_BLOCK_MAX_TIMEOUT)) | ||
847 | return -EINVAL; | 847 | return -EINVAL; |
848 | |||
849 | /* | ||
850 | * If fast_io_fail is off we have to cap | ||
851 | * dev_loss_tmo at SCSI_DEVICE_BLOCK_MAX_TIMEOUT | ||
852 | */ | ||
853 | if (rport->fast_io_fail_tmo == -1 && | ||
854 | val > SCSI_DEVICE_BLOCK_MAX_TIMEOUT) | ||
855 | return -EINVAL; | ||
856 | |||
848 | i->f->set_rport_dev_loss_tmo(rport, val); | 857 | i->f->set_rport_dev_loss_tmo(rport, val); |
849 | return count; | 858 | return count; |
850 | } | 859 | } |
@@ -925,9 +934,16 @@ store_fc_rport_fast_io_fail_tmo(struct device *dev, | |||
925 | rport->fast_io_fail_tmo = -1; | 934 | rport->fast_io_fail_tmo = -1; |
926 | else { | 935 | else { |
927 | val = simple_strtoul(buf, &cp, 0); | 936 | val = simple_strtoul(buf, &cp, 0); |
928 | if ((*cp && (*cp != '\n')) || | 937 | if ((*cp && (*cp != '\n')) || (val < 0)) |
929 | (val < 0) || (val >= rport->dev_loss_tmo)) | ||
930 | return -EINVAL; | 938 | return -EINVAL; |
939 | /* | ||
940 | * Cap fast_io_fail by dev_loss_tmo or | ||
941 | * SCSI_DEVICE_BLOCK_MAX_TIMEOUT. | ||
942 | */ | ||
943 | if ((val >= rport->dev_loss_tmo) || | ||
944 | (val > SCSI_DEVICE_BLOCK_MAX_TIMEOUT)) | ||
945 | return -EINVAL; | ||
946 | |||
931 | rport->fast_io_fail_tmo = val; | 947 | rport->fast_io_fail_tmo = val; |
932 | } | 948 | } |
933 | return count; | 949 | return count; |