From fba7f3f9c8fd4ef9e9a97d8f2c3aa06f5426edb8 Mon Sep 17 00:00:00 2001 From: andvar Date: Sat, 16 Apr 2022 16:40:54 +0000 Subject: 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. --- sys/dev/raidframe/rf_netbsdkintf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/raidframe') 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 -__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) { /* -- cgit