summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/zfs/vdev_disk.c2
-rw-r--r--module/zfs/zio.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
index d096d754f..33b7f5d15 100644
--- a/module/zfs/vdev_disk.c
+++ b/module/zfs/vdev_disk.c
@@ -693,8 +693,6 @@ vdev_disk_io_start(zio_t *zio)
return;
zio->io_error = error;
- if (error == ENOTSUP)
- v->vdev_nowritecache = B_TRUE;
break;
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 577ee7694..003940795 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -3393,6 +3393,16 @@ zio_vdev_io_assess(zio_t *zio)
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;