diff options
author | trasz <trasz@FreeBSD.org> | 2013-09-23 19:54:44 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2013-09-23 19:54:44 +0000 |
commit | 883625cd6610a9c86c5a3f649bd38259ad602ad3 (patch) | |
tree | f57493f0e367656aa2d1545a0dbdd1b134a75d41 /sys/dev/iscsi | |
parent | d232e740fa1fdf064d937d9d03973d715bcb27f7 (diff) | |
download | FreeBSD-src-883625cd6610a9c86c5a3f649bd38259ad602ad3.zip FreeBSD-src-883625cd6610a9c86c5a3f649bd38259ad602ad3.tar.gz |
Don't use M_WAITOK when running from context where sleeping is prohibited,
such as callout or a geom thread.
Approved by: re (marius)
Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r-- | sys/dev/iscsi/iscsi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 0b3d565..e22ded3 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -558,7 +558,11 @@ iscsi_callout(void *context) if (is->is_timeout < 2) return; - request = icl_pdu_new_bhs(is->is_conn, M_WAITOK); + request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + if (request == NULL) { + ISCSI_SESSION_WARN(is, "failed to allocate PDU"); + return; + } bhsno = (struct iscsi_bhs_nop_out *)request->ip_bhs; bhsno->bhsno_opcode = ISCSI_BHS_OPCODE_NOP_OUT | ISCSI_BHS_OPCODE_IMMEDIATE; |