in lockstatus(), report LK_EXCLOTHER if LK_WANT_EXCL or LK_WANT_UPGRADE

is set, since the thread that set either of those flags will be the next
one to get the lock.  fixes PR 35143.
This commit is contained in:
chs 2006-12-09 15:59:25 +00:00
parent 6f7d423e1a
commit a8459c8cc1

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lock.c,v 1.102 2006/11/01 10:17:58 yamt Exp $ */
/* $NetBSD: kern_lock.c,v 1.103 2006/12/09 15:59:25 chs Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.102 2006/11/01 10:17:58 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.103 2006/12/09 15:59:25 chs Exp $");
#include "opt_multiprocessor.h"
#include "opt_lockdebug.h"
@ -460,6 +460,8 @@ lockstatus(struct lock *lkp)
lock_type = LK_EXCLOTHER;
} else if (lkp->lk_sharecount != 0)
lock_type = LK_SHARED;
else if (lkp->lk_flags & (LK_WANT_EXCL | LK_WANT_UPGRADE))
lock_type = LK_EXCLOTHER;
INTERLOCK_RELEASE(lkp, lkp->lk_flags, s);
return (lock_type);
}