Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2017 16:00:21 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r325809 - stable/11/sys/cam/ctl
Message-ID:  <201711141600.vAEG0LLc018571@repo.freebsd.org>

Next in thread | Raw E-Mail | Index | Archive | Help
Author: trasz
Date: Tue Nov 14 16:00:21 2017
New Revision: 325809
URL: https://svnweb.freebsd.org/changeset/base/325809

Log:
  MFC r324261:
  
  Fix iSCSI target panics on concurrent session teardown and display
  (eg removing a target and doing "ctladm islist -v" at the same time).

Modified:
  stable/11/sys/cam/ctl/ctl_frontend_iscsi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- stable/11/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Nov 14 15:07:34 2017	(r325808)
+++ stable/11/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Nov 14 16:00:21 2017	(r325809)
@@ -1308,18 +1308,17 @@ cfiscsi_session_delete(struct cfiscsi_session *cs)
 	KASSERT(TAILQ_EMPTY(&cs->cs_waiting_for_data_out),
 	    ("destroying session with non-empty queue"));
 
+	mtx_lock(&softc->lock);
+	TAILQ_REMOVE(&softc->sessions, cs, cs_next);
+	mtx_unlock(&softc->lock);
+
 	cfiscsi_session_unregister_initiator(cs);
 	if (cs->cs_target != NULL)
 		cfiscsi_target_release(cs->cs_target);
 	icl_conn_close(cs->cs_conn);
 	icl_conn_free(cs->cs_conn);
-
-	mtx_lock(&softc->lock);
-	TAILQ_REMOVE(&softc->sessions, cs, cs_next);
-	cv_signal(&softc->sessions_cv);
-	mtx_unlock(&softc->lock);
-
 	free(cs, M_CFISCSI);
+	cv_signal(&softc->sessions_cv);
 }
 
 static int



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?201711141600.vAEG0LLc018571>