diff options
| author | hannken <hannken@NetBSD.org> | 2022-04-16 07:56:45 +0000 |
|---|---|---|
| committer | hannken <hannken@NetBSD.org> | 2022-04-16 07:56:45 +0000 |
| commit | 7e86e8d8305dfc45996089be8073feb313827e6a (patch) | |
| tree | aef5fd64934f6f0a7e7aa6dc5d33d413b68ab281 /sys/dev/raidframe | |
| parent | 0eeca2134c4b1077465671b490607276a13f3959 (diff) | |
Unlock vnode for VOP_IOCTL().
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 2eabdfd3e76..b8b2b9ff38a 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.405 2022/03/28 13:07:14 wiz Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.406 2022/04/16 07:57:33 hannken 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.405 2022/03/28 13:07:14 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.406 2022/04/16 07:57:33 hannken Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -2951,6 +2951,7 @@ 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 @@ -2970,6 +2971,7 @@ rf_find_raid_components(void) printf("RAIDframe: can't get disk size" " for dev %s (%d)\n", device_xname(dv), error); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VOP_CLOSE(vp, FREAD | FWRITE, NOCRED); vput(vp); continue; @@ -2981,18 +2983,19 @@ rf_find_raid_components(void) if (error) { printf("RAIDframe: can't get wedge info for " "dev %s (%d)\n", device_xname(dv), error); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VOP_CLOSE(vp, FREAD | FWRITE, NOCRED); vput(vp); continue; } if (strcmp(dkw.dkw_ptype, DKW_PTYPE_RAIDFRAME) != 0) { + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VOP_CLOSE(vp, FREAD | FWRITE, NOCRED); vput(vp); continue; } - VOP_UNLOCK(vp); ac_list = rf_get_component(ac_list, dev, vp, device_xname(dv), dkw.dkw_size, numsecs, secsize); rf_part_found = 1; /*There is a raid component on this disk*/ @@ -3013,6 +3016,7 @@ rf_find_raid_components(void) /* don't need this any more. We'll allocate it again a little later if we really do... */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VOP_CLOSE(vp, FREAD | FWRITE, NOCRED); vput(vp); |
