Skip to content

Commit cd730bd

Browse files
committed
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
When a da or ada device dissappears, outstanding IOs fail with ENXIO, not EIO. The check for EIO was probably copied from Illumos, where that is indeed the correct errno. Without this change, pulling a busy drive from a zpool would usually turn it into UNAVAIL, even though pulling an idle drive would turn it into REMOVED. With this change, it is REMOVED every time. Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that results in devd getting two resource.fs.zfs.removed events. The comment said that the event had to be sent directly instead of through the async removal thread because "the DE engine is using this information to discard prevoius I/O errors". However, the fact that vdev_geom_io_intr was never actually sending the events until now, and that vdev_geom_orphan never sent them at all, and that vdev_geom_orphan usually gets called about 2 seconds after the actual removal, means that FreeBSD's userland can cope with a late event just fine. Approved by: ken (mentor) Sponsored by: Spectra Logic Corporation MFC after: 4 weeks
1 parent 1cf78c8 commit cd730bd

File tree

1 file changed

+1
-9
lines changed
  • sys/cddl/contrib/opensolaris/uts/common/fs/zfs

1 file changed

+1
-9
lines changed

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -770,20 +770,12 @@ vdev_geom_io_intr(struct bio *bp)
770770
*/
771771
vd->vdev_notrim = B_TRUE;
772772
}
773-
if (zio->io_error == EIO && !vd->vdev_remove_wanted) {
773+
if (zio->io_error == ENXIO && !vd->vdev_remove_wanted) {
774774
/*
775775
* If provider's error is set we assume it is being
776776
* removed.
777777
*/
778778
if (bp->bio_to->error != 0) {
779-
/*
780-
* We post the resource as soon as possible, instead of
781-
* when the async removal actually happens, because the
782-
* DE is using this information to discard previous I/O
783-
* errors.
784-
*/
785-
/* XXX: zfs_post_remove() can sleep. */
786-
zfs_post_remove(zio->io_spa, vd);
787779
vd->vdev_remove_wanted = B_TRUE;
788780
spa_async_request(zio->io_spa, SPA_ASYNC_REMOVE);
789781
} else if (!vd->vdev_delayed_close) {

0 commit comments

Comments
 (0)