Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181247
b: refs/heads/master
c: f281866
h: refs/heads/master
i:
  181245: 78ad35c
  181243: fd1c9aa
  181239: c4d76ec
  181231: 6e3fd45
  181215: 7e8871a
  181183: f03fe63
  181119: e118208
  180991: 6d7d298
  180735: fe63ced
  180223: d6ecfc0
v: v3
  • Loading branch information
Hannes Reinecke authored and James Bottomley committed Jan 18, 2010
1 parent 8dad84d commit ea02f4f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e47c11c7a402a054a85cb917a6ed020f6b5fae04
refs/heads/master: f2818663c82b7297ff4aa38cbddb870dc02f7104
26 changes: 21 additions & 5 deletions trunk/drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ MODULE_PARM_DESC(dev_loss_tmo,
"Maximum number of seconds that the FC transport should"
" insulate the loss of a remote port. Once this value is"
" exceeded, the scsi target is removed. Value should be"
" between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT.");
" between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT if"
" fast_io_fail_tmo is not set.");

/*
* Netlink Infrastructure
Expand Down Expand Up @@ -842,9 +843,17 @@ store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr,
(rport->port_state == FC_PORTSTATE_NOTPRESENT))
return -EBUSY;
val = simple_strtoul(buf, &cp, 0);
if ((*cp && (*cp != '\n')) ||
(val < 0) || (val > SCSI_DEVICE_BLOCK_MAX_TIMEOUT))
if ((*cp && (*cp != '\n')) || (val < 0))
return -EINVAL;

/*
* If fast_io_fail is off we have to cap
* dev_loss_tmo at SCSI_DEVICE_BLOCK_MAX_TIMEOUT
*/
if (rport->fast_io_fail_tmo == -1 &&
val > SCSI_DEVICE_BLOCK_MAX_TIMEOUT)
return -EINVAL;

i->f->set_rport_dev_loss_tmo(rport, val);
return count;
}
Expand Down Expand Up @@ -925,9 +934,16 @@ store_fc_rport_fast_io_fail_tmo(struct device *dev,
rport->fast_io_fail_tmo = -1;
else {
val = simple_strtoul(buf, &cp, 0);
if ((*cp && (*cp != '\n')) ||
(val < 0) || (val >= rport->dev_loss_tmo))
if ((*cp && (*cp != '\n')) || (val < 0))
return -EINVAL;
/*
* Cap fast_io_fail by dev_loss_tmo or
* SCSI_DEVICE_BLOCK_MAX_TIMEOUT.
*/
if ((val >= rport->dev_loss_tmo) ||
(val > SCSI_DEVICE_BLOCK_MAX_TIMEOUT))
return -EINVAL;

rport->fast_io_fail_tmo = val;
}
return count;
Expand Down

0 comments on commit ea02f4f

Please sign in to comment.