From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:22:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BDD41065673; Sun, 2 Nov 2008 20:22:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A19D8FC1F; Sun, 2 Nov 2008 20:22:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2KMO9N047395; Sun, 2 Nov 2008 20:22:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2KMOCC047394; Sun, 2 Nov 2008 20:22:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811022022.mA2KMOCC047394@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 20:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184568 - head/sys/netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 02 Nov 2008 20:22:25 -0000 Author: rwatson Date: Sun Nov 2 20:22:24 2008 New Revision: 184568 URL: http://svn.freebsd.org/changeset/base/184568 Log: smb_vc_put() requires that the passed vcp be locked, so lock it before dropping the connection when the requested service isn't available, or we may try to release a lock that isn't locked. This prevents an assertion failure when trying to mount a non-present share using smbfs with INVARIANTS; a lock order reversal warning that immediately follows is not yet fixed. Reported by: attilio MFC after: 3 days Modified: head/sys/netsmb/smb_conn.c Modified: head/sys/netsmb/smb_conn.c ============================================================================== --- head/sys/netsmb/smb_conn.c Sun Nov 2 19:48:15 2008 (r184567) +++ head/sys/netsmb/smb_conn.c Sun Nov 2 20:22:24 2008 (r184568) @@ -218,8 +218,10 @@ out: smb_sm_unlockvclist(td); if (error == 0) *vcpp = vcp; - else if (vcp) + else if (vcp) { + smb_vc_lock(vcp, LK_EXCLUSIVE, scred->scr_td); smb_vc_put(vcp, scred); + } return error; }