mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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
This commit is contained in:
parent
6966d7767a
commit
6aaab44423
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184568
|
@ -218,8 +218,10 @@ smb_sm_lookup(struct smb_vcspec *vcspec, struct smb_sharespec *shspec,
|
||||||
smb_sm_unlockvclist(td);
|
smb_sm_unlockvclist(td);
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
*vcpp = vcp;
|
*vcpp = vcp;
|
||||||
else if (vcp)
|
else if (vcp) {
|
||||||
|
smb_vc_lock(vcp, LK_EXCLUSIVE, scred->scr_td);
|
||||||
smb_vc_put(vcp, scred);
|
smb_vc_put(vcp, scred);
|
||||||
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue