Date: Sun, 2 Nov 2008 20:22:24 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184568 - head/sys/netsmb Message-ID: <200811022022.mA2KMOCC047394@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811022022.mA2KMOCC047394>