Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flush: don't report flush error when disabling flush support #16855

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions module/os/freebsd/zfs/vdev_geom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,21 +1014,6 @@ vdev_geom_io_intr(struct bio *bp)
zio->io_error = SET_ERROR(EIO);

switch (zio->io_error) {
case ENOTSUP:
/*
* If we get ENOTSUP for BIO_FLUSH or BIO_DELETE we know
* that future attempts will never succeed. In this case
* we set a persistent flag so that we don't bother with
* requests in the future.
*/
switch (bp->bio_cmd) {
case BIO_FLUSH:
vd->vdev_nowritecache = B_TRUE;
break;
case BIO_DELETE:
break;
}
break;
case ENXIO:
if (!vd->vdev_remove_wanted) {
/*
Expand Down
5 changes: 2 additions & 3 deletions module/os/linux/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,9 +1198,8 @@ vdev_disk_io_flush_completion(struct bio *bio)
{
zio_t *zio = bio->bi_private;
zio->io_error = bi_status_to_errno(bio->bi_status);

if (zio->io_error && (zio->io_error == EOPNOTSUPP))
zio->io_vd->vdev_nowritecache = B_TRUE;
if (zio->io_error == EOPNOTSUPP || zio->io_error == ENOTTY)
zio->io_error = SET_ERROR(ENOTSUP);

bio_put(bio);
ASSERT3S(zio->io_error, >=, 0);
Expand Down
11 changes: 7 additions & 4 deletions module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -4606,13 +4606,16 @@ 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.
* 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;
}

if (zio->io_error)
zio->io_pipeline = ZIO_INTERLOCK_PIPELINE;
Expand Down
Loading