summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_target_stripe.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/dm/dm_target_stripe.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/dm/dm_target_stripe.c')
-rw-r--r--sys/dev/dm/dm_target_stripe.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/dm/dm_target_stripe.c b/sys/dev/dm/dm_target_stripe.c
index 84d356e8b34..a56838d87b3 100644
--- a/sys/dev/dm/dm_target_stripe.c
+++ b/sys/dev/dm/dm_target_stripe.c
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_stripe.c,v 1.15 2011/08/27 17:09:09 ahoka Exp $*/
+/*$NetBSD: dm_target_stripe.c,v 1.16 2011/10/14 09:23:30 hannken Exp $*/
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -329,7 +329,10 @@ dm_target_stripe_deps(dm_table_entry_t * table_en, prop_array_t prop_array)
tsc = table_en->target_config;
TAILQ_FOREACH(tlc, &tsc->stripe_devs, entries) {
- if ((error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred)) != 0)
+ vn_lock(tlc->pdev->pdev_vnode, LK_SHARED | LK_RETRY);
+ error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred);
+ VOP_UNLOCK(tlc->pdev->pdev_vnode);
+ if (error != 0)
return error;
prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev);
4'>initialize necessary members of struct buf. PR/32462 from Reinoud Zandijk.yamt 2006-01-04- add simple functions to allocate/free a buffer for i/o.yamt 2005-12-11merge ktrace-lwp.christos 2005-05-29- avoid variable shadowingchristos 2005-02-27nuke trailing whitespaceperry 2005-02-12The 'next' argument to rf_CreateDiskQueueData is always NULL. Sinceoster 2005-02-12Add a 'waitflag' argument to rf_CreateDiskQueueData() and use it tooster 2005-02-05CreateDiskQueueData() doesn't need to use void * for raidPtr.oster 2004-11-24Only touch bufpool whilst in splbio(). (That should be the caseoster