summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/vdev_disk.c
diff options
context:
space:
mode:
authoreschrock <none@none>2006-04-08 23:33:38 -0700
committereschrock <none@none>2006-04-08 23:33:38 -0700
commitb468a217b67dc26ce21da5d5a2ca09bb6249e4fa (patch)
tree71b6bb81b469d8127e12b97549cb177aa5deac3e /usr/src/uts/common/fs/zfs/vdev_disk.c
parent25cf1a301a396c38e8adf52c15f537b80d2483f7 (diff)
downloadillumos-gate-b468a217b67dc26ce21da5d5a2ca09bb6249e4fa.tar.gz
6407791 bringover into ZFS results in s. files newer than extracted source
6409927 failed DKIOCFLUSHWRITECACHE ioctls should not generate ereports 6410371 need to reserve more pool names
Diffstat (limited to 'usr/src/uts/common/fs/zfs/vdev_disk.c')
-rw-r--r--usr/src/uts/common/fs/zfs/vdev_disk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev_disk.c b/usr/src/uts/common/fs/zfs/vdev_disk.c
index 0b4c2c9696..2c50ba3837 100644
--- a/usr/src/uts/common/fs/zfs/vdev_disk.c
+++ b/usr/src/uts/common/fs/zfs/vdev_disk.c
@@ -174,6 +174,12 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
*ashift = highbit(MAX(dkm.dki_lbsize, SPA_MINBLOCKSIZE)) - 1;
+ /*
+ * Clear the nowritecache bit, so that on a vdev_reopen() we will
+ * try again.
+ */
+ vd->vdev_nowritecache = B_FALSE;
+
return (0);
}
@@ -249,6 +255,11 @@ vdev_disk_io_start(zio_t *zio)
case DKIOCFLUSHWRITECACHE:
+ if (vd->vdev_nowritecache) {
+ zio->io_error = ENOTSUP;
+ break;
+ }
+
zio->io_dk_callback.dkc_callback = vdev_disk_ioctl_done;
zio->io_dk_callback.dkc_cookie = zio;
@@ -263,8 +274,17 @@ vdev_disk_io_start(zio_t *zio)
* upon completion.
*/
return;
+ } else if (error == ENOTSUP) {
+ /*
+ * If we get ENOTSUP, we know that no future
+ * attempts will ever succeed. In this case we
+ * set a persistent bit so that we don't bother
+ * with the ioctl in the future.
+ */
+ vd->vdev_nowritecache = B_TRUE;
}
zio->io_error = error;
+
break;
default: