From 74ed4a9a17d27ec732461ed5f04c82959c940a67 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 17 Jul 2006 16:12:59 +0000 Subject: [PATCH] Always lock the lockmgr lock when creating an smb connection object rather than only locking it if INVARIANTS is enabled. All the callers expect smb_co_init() to return with the lock held. Tested by: "Jiawei Ye" --- sys/netsmb/smb_conn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c index 0791249fcd22..038402adeac4 100644 --- a/sys/netsmb/smb_conn.c +++ b/sys/netsmb/smb_conn.c @@ -233,7 +233,8 @@ smb_co_init(struct smb_connobj *cp, int level, char *objname, struct thread *td) lockinit(&cp->co_lock, PZERO, objname, 0, 0); cp->co_level = level; cp->co_usecount = 1; - KASSERT(smb_co_lock(cp, LK_EXCLUSIVE, td) == 0, ("smb_co_init: lock failed")); + if (smb_co_lock(cp, LK_EXCLUSIVE, td) != 0) + panic("smb_co_init: lock failed"); } static void