mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-05-10 18:58:27 +03:00
flush: don't report flush error when disabling flush support
The first time a device returns ENOTSUP in repsonse to a flush request, we set vdev_nowritecache so we don't issue flushes in the future and instead just pretend the succeeded. However, we still return an error for the initial flush, even though we just decided such errors are meaningless! So, when setting vdev_nowritecache in response to a flush error, also reset the error code to assume success. 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:
parent
76f57ab9f7
commit
fbea92432a
@ -4608,11 +4608,14 @@ 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 or ENOTTY, we know that no future
|
||||||
* attempts will ever succeed. In this case we set a persistent
|
* attempts will ever succeed. In this case we set a persistent
|
||||||
* boolean flag so that we don't bother with it in the future.
|
* 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) &&
|
if ((zio->io_error == ENOTSUP || zio->io_error == ENOTTY) &&
|
||||||
zio->io_type == ZIO_TYPE_FLUSH && vd != NULL)
|
zio->io_type == ZIO_TYPE_FLUSH && vd != NULL) {
|
||||||
vd->vdev_nowritecache = B_TRUE;
|
vd->vdev_nowritecache = B_TRUE;
|
||||||
|
zio->io_error = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (zio->io_error)
|
if (zio->io_error)
|
||||||
zio->io_pipeline = ZIO_INTERLOCK_PIPELINE;
|
zio->io_pipeline = ZIO_INTERLOCK_PIPELINE;
|
||||||
|
Loading…
Reference in New Issue
Block a user