From owner-svn-src-all@FreeBSD.ORG Thu Feb 5 07:46:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A11D5888; Thu, 5 Feb 2015 07:46:35 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA0FF5D; Thu, 5 Feb 2015 07:46:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t157kZME062167; Thu, 5 Feb 2015 07:46:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t157kZRg062166; Thu, 5 Feb 2015 07:46:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201502050746.t157kZRg062166@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 5 Feb 2015 07:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278237 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 07:46:35 -0000 Author: trasz Date: Thu Feb 5 07:46:34 2015 New Revision: 278237 URL: https://svnweb.freebsd.org/changeset/base/278237 Log: Don't call callout_drain() with iscsi mutex held; this fixes a warning that was introduced recently. While here, don't try to access is_terminating without lock. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu Feb 5 07:32:24 2015 (r278236) +++ head/sys/dev/iscsi/iscsi.c Thu Feb 5 07:46:34 2015 (r278237) @@ -421,6 +421,7 @@ iscsi_maintenance_thread_terminate(struc sx_xunlock(&sc->sc_lock); icl_conn_close(is->is_conn); + callout_drain(&is->is_callout); ISCSI_SESSION_LOCK(is); @@ -434,8 +435,6 @@ iscsi_maintenance_thread_terminate(struc cv_signal(&is->is_login_cv); #endif - callout_drain(&is->is_callout); - iscsi_session_cleanup(is, true); KASSERT(TAILQ_EMPTY(&is->is_outstanding), @@ -511,6 +510,7 @@ iscsi_session_reconnect(struct iscsi_ses static void iscsi_session_terminate(struct iscsi_session *is) { + if (is->is_terminating) return; @@ -532,12 +532,14 @@ iscsi_callout(void *context) is = context; - if (is->is_terminating) + ISCSI_SESSION_LOCK(is); + if (is->is_terminating) { + ISCSI_SESSION_UNLOCK(is); return; + } callout_schedule(&is->is_callout, 1 * hz); - ISCSI_SESSION_LOCK(is); is->is_timeout++; if (is->is_waiting_for_iscsid) {