summaryrefslogtreecommitdiffstats
path: root/sys/netsmb
diff options
context:
space:
mode:
authorpeadar <peadar@FreeBSD.org>2005-05-13 11:27:48 +0000
committerpeadar <peadar@FreeBSD.org>2005-05-13 11:27:48 +0000
commit67a392cd252956828d37fc77abc33af097ddbba0 (patch)
tree9d9790ea4db0901226cd7259e2796a7b0fd9d79a /sys/netsmb
parent84c444f8a44fb1e528e457c62b8f28ea9579c476 (diff)
downloadFreeBSD-src-67a392cd252956828d37fc77abc33af097ddbba0.zip
FreeBSD-src-67a392cd252956828d37fc77abc33af097ddbba0.tar.gz
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
Diffstat (limited to 'sys/netsmb')
-rw-r--r--sys/netsmb/smb_conn.c5
1 files changed, 2 insertions, 3 deletions
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");
}
OpenPOWER on IntegriCloud