]> granicus.if.org Git - zfs/commitdiff
OpenZFS 7448 - ZFS doesn't notice when disk vdevs have no write cache
authorGeorge Melikov <mail@gmelikov.ru>
Sat, 4 Feb 2017 17:23:50 +0000 (20:23 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 4 Feb 2017 17:23:50 +0000 (09:23 -0800)
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

module/zfs/vdev_disk.c
module/zfs/zio.c

index d096d754f70912265535bf1e3074e07543da3992..33b7f5d1550a77e9ba04e31e32169d8bfc95a638 100644 (file)
@@ -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;
 
index 577ee76945d68cbcde31e6d71c742ca8c5a0d663..0039407953d9d0fde5c678508ff60701edc4a533 100644 (file)
@@ -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;