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 Tony Hutter
parent 14bf91a043
commit 5d8c081193
1 changed files with 1 additions and 0 deletions

View File

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