Module Name: src
Committed By: yamt
Date: Sat May 28 00:53:04 UTC 2011
Modified Files:
src/sys/dev/raidframe: rf_reconstruct.c
Log Message:
rf_ReconstructInPlace: don't leave a vnode open on errors.
fixes a part of PR/44972.
To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/raidframe/rf_reconstruct.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/raidframe/rf_reconstruct.c
diff -u src/sys/dev/raidframe/rf_reconstruct.c:1.114 src/sys/dev/raidframe/rf_reconstruct.c:1.115
--- src/sys/dev/raidframe/rf_reconstruct.c:1.114 Tue May 24 07:33:41 2011
+++ src/sys/dev/raidframe/rf_reconstruct.c Sat May 28 00:53:04 2011
@@ -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);