diff options
author | George Wilson <George.Wilson@Sun.COM> | 2008-10-30 18:04:43 -0700 |
---|---|---|
committer | George Wilson <George.Wilson@Sun.COM> | 2008-10-30 18:04:43 -0700 |
commit | a31e67878a1bf006016a43cafa1fdffa37e432e6 (patch) | |
tree | 93ced24d176260a92b969f2670e790417baeda35 /usr/src/uts/common/fs/zfs/vdev.c | |
parent | d6b3018d1023e158e4d4f1315056f98b55c6f590 (diff) | |
download | illumos-gate-a31e67878a1bf006016a43cafa1fdffa37e432e6.tar.gz |
6764914 vdev_reopen() can lead to failed allocations
Diffstat (limited to 'usr/src/uts/common/fs/zfs/vdev.c')
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ -1871,6 +1871,19 @@ vdev_writeable(vdev_t *vd) } 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) { ASSERT(zio->io_vd == vd); |