aboutsummaryrefslogtreecommitdiff
path: root/sys/netsmb
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2008-11-02 20:22:24 +0000
committerRobert Watson <rwatson@FreeBSD.org>2008-11-02 20:22:24 +0000
commit6aaab44423f5c3600c7cb3ffabb8ea6c64f05221 (patch)
tree2042fcdb1ae11e45db86a371fb69f95e1e5a17bd /sys/netsmb
parent6966d7767a1e8beea1326bde12492e9a1354d1d9 (diff)
downloadsrc-6aaab44423f5c3600c7cb3ffabb8ea6c64f05221.tar.gz
src-6aaab44423f5c3600c7cb3ffabb8ea6c64f05221.zip
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
Notes
Notes: svn path=/head/; revision=184568
Diffstat (limited to 'sys/netsmb')
-rw-r--r--sys/netsmb/smb_conn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c
index 82f6382da1f8..3480181502d3 100644
--- a/sys/netsmb/smb_conn.c
+++ b/sys/netsmb/smb_conn.c
@@ -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;
}