diff options
| author | christos <christos@NetBSD.org> | 2007-06-24 21:38:21 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2007-06-24 21:38:21 +0000 |
| commit | daebf0edfef2642980c61281d50f001470f8a1fa (patch) | |
| tree | 04aa5343fd3b9c1d38eece1b091e8624af462b8c /sys/dev/raidframe | |
| parent | a65158cbe3bc5e511e390d5befa075f3c3eee613 (diff) | |
don't leak a vnode in the wedge case.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 0f6ce42bed5..8f6521fa155 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.227 2007/03/12 18:18:31 ad Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.228 2007/06/24 21:38:21 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -146,7 +146,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.227 2007/03/12 18:18:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.228 2007/06/24 21:38:21 christos Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -2787,18 +2787,17 @@ rf_find_raid_components() struct dkwedge_info dkw; error = VOP_IOCTL(vp, DIOCGWEDGEINFO, &dkw, FREAD, NOCRED, 0); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, 0); + vput(vp); if (error) { printf("RAIDframe: can't get wedge info for " "dev %s (%d)\n", dv->dv_xname, error); -out: - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - VOP_CLOSE(vp, FREAD | FWRITE, NOCRED, 0); - vput(vp); continue; } if (strcmp(dkw.dkw_ptype, DKW_PTYPE_RAIDFRAME) != 0) - goto out; + continue; ac_list = rf_get_component(ac_list, dev, vp, dv->dv_xname, dkw.dkw_size); |
