FreeBSD: fix unpropagated error

When performing I/O on FreeBSD using a file based vdev ensure all
errors encountered when reading/writing are propagated through the
zio pipeline.  

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12904
This commit is contained in:
наб 2021-12-23 20:39:29 +01:00 committed by GitHub
parent 18e4f67960
commit 1135d0a5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,6 +234,7 @@ vdev_file_io_strategy(void *arg)
err = zfs_file_pwrite(vf->vf_file, buf, size, off, &resid); err = zfs_file_pwrite(vf->vf_file, buf, size, off, &resid);
abd_return_buf(zio->io_abd, buf, size); abd_return_buf(zio->io_abd, buf, size);
} }
zio->io_error = err;
if (resid != 0 && zio->io_error == 0) if (resid != 0 && zio->io_error == 0)
zio->io_error = ENOSPC; zio->io_error = ENOSPC;