From daebf0edfef2642980c61281d50f001470f8a1fa Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 24 Jun 2007 21:38:21 +0000 Subject: don't leak a vnode in the wedge case. --- sys/dev/raidframe/rf_netbsdkintf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sys/dev/raidframe') 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 -__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 #include @@ -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); -- cgit