summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorandvar <andvar@NetBSD.org>2022-04-16 16:40:54 +0000
committerandvar <andvar@NetBSD.org>2022-04-16 16:40:54 +0000
commitfba7f3f9c8fd4ef9e9a97d8f2c3aa06f5426edb8 (patch)
tree14ba5d6d7f2a0abdfa20e23f01c98819815deeb1 /sys/dev/raidframe
parent6c86a1d4cd9989571427ffc40de8493e08065450 (diff)
Fix mistake in error branch locking caused by previous changes.
vput(vp) also unlocks vp, thus unlocking happens twice in error flow causing kernel to panic with failed assertion lktype != LK_NONE in vfs_vnode.c#778. Thanks riastradh with finding the issue.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index b8b2b9ff38a..0fb79f5eee4 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.406 2022/04/16 07:57:33 hannken Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.407 2022/04/16 16:40:54 andvar Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.406 2022/04/16 07:57:33 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.407 2022/04/16 16:40:54 andvar Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_autoconfig.h"
@@ -2951,7 +2951,6 @@ rf_find_raid_components(void)
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_OPEN(vp, FREAD | FSILENT, NOCRED);
- VOP_UNLOCK(vp);
if (error) {
/* "Who cares." Continue looking
@@ -2960,6 +2959,7 @@ rf_find_raid_components(void)
continue;
}
+ VOP_UNLOCK(vp);
error = getdisksize(vp, &numsecs, &secsize);
if (error) {
/*