aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_frontend_iscsi.c
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2018-09-11 11:39:59 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2018-09-11 11:39:59 +0000
commitd4eab1373824ad00681f27765b0bc9200f53480d (patch)
treee1dbe1a6ad40dce838c40bef86f4cb7b0ac53c26 /sys/cam/ctl/ctl_frontend_iscsi.c
parent87acc14608c30f365f6f2e4a1de573169d5e6615 (diff)
downloadsrc-d4eab1373824ad00681f27765b0bc9200f53480d.tar.gz
src-d4eab1373824ad00681f27765b0bc9200f53480d.zip
Make the wait in cfiscsi_offline() interruptible. This is the second half
of the fix/workaround for the "ctld hanging on reload" problem. PR: 220175 Reported by: Eugene M. Zheganin <emz at norma.perm.ru> Tested by: Eugene M. Zheganin <emz at norma.perm.ru> Approved by: re (kib) MFC after: 2 weeks Sponsored by: playkey.net
Notes
Notes: svn path=/head/; revision=338586
Diffstat (limited to 'sys/cam/ctl/ctl_frontend_iscsi.c')
-rw-r--r--sys/cam/ctl/ctl_frontend_iscsi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index 83082b0f6469..d5be20c2a215 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -1434,7 +1434,7 @@ cfiscsi_offline(void *arg)
struct cfiscsi_softc *softc;
struct cfiscsi_target *ct;
struct cfiscsi_session *cs;
- int online;
+ int error, online;
ct = (struct cfiscsi_target *)arg;
softc = ct->ct_softc;
@@ -1456,8 +1456,14 @@ cfiscsi_offline(void *arg)
if (cs->cs_target == ct)
break;
}
- if (cs != NULL)
- cv_wait(&softc->sessions_cv, &softc->lock);
+ if (cs != NULL) {
+ error = cv_wait_sig(&softc->sessions_cv, &softc->lock);
+ if (error != 0) {
+ CFISCSI_SESSION_DEBUG(cs,
+ "cv_wait failed with error %d\n", error);
+ break;
+ }
+ }
} while (cs != NULL && ct->ct_online == 0);
mtx_unlock(&softc->lock);
if (online > 0)