summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2017-02-04 20:23:50 +0300
committerBrian Behlendorf <[email protected]>2017-02-04 09:23:50 -0800
commit298ec40b6d9edcbde7b1fbbf172bd05be0eb9b97 (patch)
tree087e08848d4c9d99f9424210a7c3db8966d42cd1 /module
parent0a252daed3bafb71740ed37bd039bd421277bc82 (diff)
OpenZFS 7448 - ZFS doesn't notice when disk vdevs have no write cache
Authored by: Hans Rosenfeld <[email protected]> Reviewed by: Dan Fields <[email protected]> Reviewed by: Alek Pinchuk <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed-by: Don Brady <[email protected]> Reviewed-by: Tim Chase <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7448 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/295438b Closes #5737
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;