Example #1
0
static int
vdev_file_io_done(zio_t *zio)
{
	vdev_t *vd = zio->io_vd;

	if (zio_injection_enabled && zio->io_error == 0)
		zio->io_error = zio_handle_device_injection(vd, EIO);

	/*
	 * If an error has been encountered then attempt to probe the device
	 * to determine if it's still accessible.
	 */
	if (zio->io_error == EIO && vdev_probe(vd) != 0) {
		if (!vd->vdev_is_failing) {
			vd->vdev_is_failing = B_TRUE;
			zfs_ereport_post(FM_EREPORT_ZFS_PROBE_FAILURE,
			    vd->vdev_spa, vd, zio, 0, 0);
		}
	}

	vdev_queue_io_done(zio);

	if (zio->io_type == ZIO_TYPE_WRITE)
		vdev_cache_write(zio);

	return (ZIO_PIPELINE_CONTINUE);
}
Example #2
0
static void
vdev_file_io_done(zio_t *zio)
{
	vdev_queue_io_done(zio);

#ifndef _KERNEL
	if (zio->io_type == ZIO_TYPE_WRITE)
		vdev_cache_write(zio);
#endif

	if (zio_injection_enabled && zio->io_error == 0)
		zio->io_error = zio_handle_device_injection(zio->io_vd, EIO);

	zio_next_stage(zio);
}