From 67a392cd252956828d37fc77abc33af097ddbba0 Mon Sep 17 00:00:00 2001 From: peadar Date: Fri, 13 May 2005 11:27:48 +0000 Subject: lockmgr(...,LK_DRAIN,...) requires a balancing LK_RELEASE: recent INVARIANTS dependent checks in userret() pinpointed a missing invocation here. Remove an unused variable while here. Reviewed By: bp@ Reported By: yongari@ MFC After: 3 days --- sys/netsmb/smb_conn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/netsmb') diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c index fbb523f..868fbaa 100644 --- a/sys/netsmb/smb_conn.c +++ b/sys/netsmb/smb_conn.c @@ -95,6 +95,7 @@ smb_sm_done(void) SMBERROR("%d connections still active\n", smb_vclist.co_usecount - 1); return EBUSY; } + lockmgr(&smb_vclist.co_lock, LK_DRAIN, 0, curthread); smb_co_done(&smb_vclist); return 0; } @@ -239,6 +240,7 @@ static void smb_co_done(struct smb_connobj *cp) { smb_sl_destroy(&cp->co_interlock); + lockmgr(&cp->co_lock, LK_RELEASE, 0, curthread); lockdestroy(&cp->co_lock); } @@ -313,16 +315,13 @@ void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred) { struct thread *td = scred->scr_td; - int flags; - flags = LK_RELEASE; SMB_CO_LOCK(cp); if (cp->co_usecount > 1) { cp->co_usecount--; } else if (cp->co_usecount == 1) { cp->co_usecount--; cp->co_flags |= SMBO_GONE; - flags = LK_DRAIN; } else { SMBERROR("negative usecount"); } -- cgit v1.1