Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe rf_ReconstructInPlace: don't leave a vnode...
details: https://anonhg.NetBSD.org/src/rev/870f0daef1e7
branches: trunk
changeset: 765470:870f0daef1e7
user: yamt <yamt%NetBSD.org@localhost>
date: Sat May 28 00:53:04 2011 +0000
description:
rf_ReconstructInPlace: don't leave a vnode open on errors.
fixes a part of PR/44972.
diffstat:
sys/dev/raidframe/rf_reconstruct.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (34 lines):
diff -r 08c64d7b90d4 -r 870f0daef1e7 sys/dev/raidframe/rf_reconstruct.c
--- a/sys/dev/raidframe/rf_reconstruct.c Sat May 28 00:07:56 2011 +0000
+++ b/sys/dev/raidframe/rf_reconstruct.c Sat May 28 00:53:04 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_reconstruct.c,v 1.114 2011/05/24 07:33:41 buhrow Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.115 2011/05/28 00:53:04 yamt Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.114 2011/05/24 07:33:41 buhrow Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.115 2011/05/28 00:53:04 yamt Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -456,6 +456,7 @@
How about actually getting a vp for it? */
if ((retcode = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0) {
+ vn_close(vp, FREAD | FWRITE, kauth_cred_get());
rf_lock_mutex2(raidPtr->mutex);
raidPtr->reconInProgress--;
rf_signal_cond2(raidPtr->waitForReconCond);
@@ -465,6 +466,7 @@
retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, curlwp->l_cred);
if (retcode) {
+ vn_close(vp, FREAD | FWRITE, kauth_cred_get());
rf_lock_mutex2(raidPtr->mutex);
raidPtr->reconInProgress--;
rf_signal_cond2(raidPtr->waitForReconCond);
Home |
Main Index |
Thread Index |
Old Index