Authored by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Reviewed-by: Don Brady <don.brady@intel.com>
Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
OpenZFS-issue: https://www.illumos.org/issues/7448
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/
295438b
Closes #5737
return;
zio->io_error = error;
- if (error == ENOTSUP)
- v->vdev_nowritecache = B_TRUE;
break;
vd->vdev_cant_write = B_TRUE;
}
+ /*
+ * If a cache flush returns ENOTSUP or ENOTTY, we know that no future
+ * attempts will ever succeed. In this case we set a persistent bit so
+ * that we don't bother with it in the future.
+ */
+ if ((zio->io_error == ENOTSUP || zio->io_error == ENOTTY) &&
+ zio->io_type == ZIO_TYPE_IOCTL &&
+ zio->io_cmd == DKIOCFLUSHWRITECACHE && vd != NULL)
+ vd->vdev_nowritecache = B_TRUE;
+
if (zio->io_error)
zio->io_pipeline = ZIO_INTERLOCK_PIPELINE;