summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_reconstruct.c
diff options
context:
space:
mode:
authorhannken <hannken@NetBSD.org>2011-10-14 09:23:28 +0000
committerhannken <hannken@NetBSD.org>2011-10-14 09:23:28 +0000
commit6e75bb0dfb296e532c3571fbc1a833003faf481a (patch)
tree51f5f0ca283056d92e4b486cdbe9478c271243b9 /sys/dev/raidframe/rf_reconstruct.c
parentc8937d29ec57fb2b042e9dea3d3acdecfcbf991f (diff)
Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock. Make all calls outside of file systems respect it. The calls from file systems need review. No objections from tech-kern.
Diffstat (limited to 'sys/dev/raidframe/rf_reconstruct.c')
-rw-r--r--sys/dev/raidframe/rf_reconstruct.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c
index 1504366d8d3..06943be4c67 100644
--- a/sys/dev/raidframe/rf_reconstruct.c
+++ b/sys/dev/raidframe/rf_reconstruct.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_reconstruct.c,v 1.116 2011/08/03 15:00:29 oster Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.117 2011/10/14 09:23:30 hannken 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.116 2011/08/03 15:00:29 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.117 2011/10/14 09:23:30 hannken Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -456,7 +456,10 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
/* Ok, so we can at least do a lookup...
How about actually getting a vp for it? */
- if ((retcode = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0) {
+ vn_lock(vp, LK_SHARED | LK_RETRY);
+ retcode = VOP_GETATTR(vp, &va, curlwp->l_cred);
+ VOP_UNLOCK(vp);
+ if (retcode != 0) {
vn_close(vp, FREAD | FWRITE, kauth_cred_get());
rf_lock_mutex2(raidPtr->mutex);
raidPtr->reconInProgress--;