From owner-svn-src-head@FreeBSD.ORG Tue Sep 24 09:33:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E4A41FA1; Tue, 24 Sep 2013 09:33:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B664A2E2B; Tue, 24 Sep 2013 09:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8O9XVnw071472; Tue, 24 Sep 2013 09:33:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8O9XVUq071471; Tue, 24 Sep 2013 09:33:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201309240933.r8O9XVUq071471@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 24 Sep 2013 09:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255837 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Sep 2013 09:33:32 -0000 Author: trasz Date: Tue Sep 24 09:33:31 2013 New Revision: 255837 URL: http://svnweb.freebsd.org/changeset/base/255837 Log: Fix a few instances of M_WAITOK in threads marked as prohibited from sleep, missed in r255824. Approved by: re (kib) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Sep 24 08:40:41 2013 (r255836) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Sep 24 09:33:31 2013 (r255837) @@ -2306,6 +2306,7 @@ cfiscsi_datamove(union ctl_io *io) if (response == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); + icl_pdu_free(request); cfiscsi_session_terminate(cs); return; } @@ -2337,6 +2338,7 @@ cfiscsi_datamove(union ctl_io *io) if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); + icl_pdu_free(request); icl_pdu_free(response); cfiscsi_session_terminate(cs); return; @@ -2406,7 +2408,13 @@ cfiscsi_datamove(union ctl_io *io) "task tag 0x%x, target transfer tag 0x%x", bhssc->bhssc_initiator_task_tag, target_transfer_tag); #endif - cdw = uma_zalloc(cfiscsi_data_wait_zone, M_WAITOK | M_ZERO); + cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO); + if (cdw == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + } cdw->cdw_ctl_io = io; cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; @@ -2435,7 +2443,13 @@ cfiscsi_datamove(union ctl_io *io) * XXX: We should limit the number of outstanding R2T PDUs * per task to MaxOutstandingR2T. */ - response = cfiscsi_pdu_new_response(request, M_WAITOK); + response = cfiscsi_pdu_new_response(request, M_NOWAIT); + if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + } bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T; bhsr2t->bhsr2t_flags = 0x80;