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;
 }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to