flush: only detect lack of flush support in one place

It seems there's no good reason for vdev_disk & vdev_geom to explicitly
detect no support for flush and set vdev_nowritecache.  Instead, just
signal it by setting the error to ENOTSUP, and let zio_vdev_io_assess()
take care of it in one place.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16855
This commit is contained in:
Rob Norris
2024-07-01 11:19:16 +10:00
committed by Brian Behlendorf
parent fbea92432a
commit 46e06feded
3 changed files with 5 additions and 21 deletions
+3 -3
View File
@@ -4606,13 +4606,13 @@ zio_vdev_io_assess(zio_t *zio)
}
/*
* If a cache flush returns ENOTSUP or ENOTTY, we know that no future
* If a cache flush returns ENOTSUP we know that no future
* attempts will ever succeed. In this case we set a persistent
* boolean flag so that we don't bother with it in the future, and
* then we act like the flush succeeded.
*/
if ((zio->io_error == ENOTSUP || zio->io_error == ENOTTY) &&
zio->io_type == ZIO_TYPE_FLUSH && vd != NULL) {
if (zio->io_error == ENOTSUP && zio->io_type == ZIO_TYPE_FLUSH &&
vd != NULL) {
vd->vdev_nowritecache = B_TRUE;
zio->io_error = 0;
}