Re: [PATCH v2 08/15] scsi_transport_srp: Add transport layer error handling

David Dillow
2013-07-01T11:19:14Z

On Mon, 2013-07-01 at 09:01 +0200, Bart Van Assche wrote:
> On 06/30/13 23:05, David Dillow wrote:
> > On Fri, 2013-06-28 at 14:53 +0200, Bart Van Assche wrote:
> >> +int srp_tmo_valid(int fast_io_fail_tmo, int dev_loss_tmo)
> >> +{
> >> + return (fast_io_fail_tmo < 0 || dev_loss_tmo < 0 ||
> >> + fast_io_fail_tmo < dev_loss_tmo) &&
> >> + fast_io_fail_tmo < LONG_MAX / HZ &&
> >> + dev_loss_tmo < LONG_MAX / HZ ? 0 : -EINVAL;
> >> +}
> >
> > They should also be capped by SCSI_DEVICE_BLOCK_MAX_TIMEOUT instead of
> > LONG_MAX / HZ, I think.
>
> The fast_io_fail_tmo should indeed be capped by that value. However, I'm
> not sure about dev_loss_tmo. I think there are several use cases (e.g.
> initiator-side mirroring) where it's useful to set dev_loss_tmo to a
> larger value than ten minutes.

Ah, yes, very good point.