summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Crowe <kevin.crowe@nexenta.com>2013-08-07 13:34:06 -0400
committerDan McDonald <danmcd@nexenta.com>2013-08-13 11:25:40 -0400
commitffc5bd0fe44a6f6529e738f1c202f788b1355046 (patch)
treed56d4b3b20de9836dbce6cd64b1f3ecf9981a258
parent18e649782fcf9da52d755b2074b4b9382426c818 (diff)
downloadillumos-joyent-ffc5bd0fe44a6f6529e738f1c202f788b1355046.tar.gz
3994 uscsi_timeout of 0 sent to ses target driver can hang processes in biowait with a cmd stuck in HBA.
Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/uts/common/io/scsi/targets/ses.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/uts/common/io/scsi/targets/ses.c b/usr/src/uts/common/io/scsi/targets/ses.c
index cc224296ed..dc6267e4c3 100644
--- a/usr/src/uts/common/io/scsi/targets/ses.c
+++ b/usr/src/uts/common/io/scsi/targets/ses.c
@@ -24,6 +24,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright (c) 2011 Bayard G. Bell. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/modctl.h>
@@ -1103,7 +1104,10 @@ ses_get_pkt(struct buf *bp, int (*func)())
if (pkt == (struct scsi_pkt *)NULL)
return;
bcopy(scmd->uscsi_cdb, pkt->pkt_cdbp, (size_t)scmd->uscsi_cdblen);
- pkt->pkt_time = scmd->uscsi_timeout;
+
+ /* Set an upper bound timeout of ses_io_time if zero is passed in */
+ pkt->pkt_time = (scmd->uscsi_timeout == 0) ?
+ ses_io_time : scmd->uscsi_timeout;
pkt->pkt_comp = ses_callback;
pkt->pkt_private = (opaque_t)ssc;