From a31e67878a1bf006016a43cafa1fdffa37e432e6 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Thu, 30 Oct 2008 18:04:43 -0700 Subject: 6764914 vdev_reopen() can lead to failed allocations --- usr/src/uts/common/fs/zfs/vdev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'usr/src/uts/common/fs/zfs/vdev.c') diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index 240f955ea2..38b238e3ed 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -1870,6 +1870,19 @@ vdev_writeable(vdev_t *vd) return (!vdev_is_dead(vd) && !vd->vdev_cant_write); } +boolean_t +vdev_allocatable(vdev_t *vd) +{ + /* + * We currently allow allocations from vdevs which maybe in the + * process of reopening (i.e. VDEV_STATE_CLOSED). If the device + * fails to reopen then we'll catch it later when we're holding + * the proper locks. + */ + return (!(vdev_is_dead(vd) && vd->vdev_state != VDEV_STATE_CLOSED) && + !vd->vdev_cant_write); +} + boolean_t vdev_accessible(vdev_t *vd, zio_t *zio) { -- cgit v1.2.3