Skip to content

Commit

Permalink
File based pools can BSOD
Browse files Browse the repository at this point in the history
More care when accessing open file was required.

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Jan 19, 2025
1 parent 7d19d56 commit 61e1012
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions module/os/macos/zfs/vdev_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ vdev_file_io_start(zio_t *zio)
{
vdev_t *vd = zio->io_vd;
vdev_file_t *vf = vd->vdev_tsd;
zfs_file_t *fp = vf->vf_file;
int error = 0;

#ifdef CLOSE_ON_UNMOUNT
Expand Down Expand Up @@ -272,7 +271,8 @@ vdev_file_io_start(zio_t *zio)
* Issue the flush. If successful, the response will
* be handled in the completion callback, so we're done.
*/
zio->io_error = zfs_file_fsync(fp, 0);
if (vf)
zio->io_error = zfs_file_fsync(vf->vf_file, 0);
}

zio->io_error = error;
Expand Down
2 changes: 1 addition & 1 deletion module/os/macos/zfs/zvolIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ zvol_os_is_zvol_impl(const char *path)
dprintf("%s: processing '%s'\n", __func__, path);

/* Validate path */
if (path == 0 || strlen(path) <= 1) {
if (path == NULL || strlen(path) <= 1) {
dprintf("%s no path provided\n", __func__);
return (SET_ERROR(ret));
}
Expand Down

0 comments on commit 61e1012

Please sign in to comment.