Skip to content

Commit

Permalink
Unmounting snapshots need to open correct zfsvfs
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Oct 19, 2023
1 parent 24468e0 commit b508b29
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/libzfs/os/windows/libzfs_mount_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,19 @@ unmount_snapshots(zfs_handle_t *zhp, const char *mntpt, int flags)
if (strncmp("/.zfs/snapshot/", &entry.mnt_mountp[len],
15) == 0) {
/* Unmount it */
do_unmount_impl(zhp, entry.mnt_mountp,
zfs_handle_t *szhp;
szhp = make_dataset_handle(zhp->zfs_hdl,
entry.mnt_special);
if (szhp == NULL) {
fprintf(stderr,
"Unable to unmount '%s'\r\n",
entry.mnt_special);
continue;
}

do_unmount_impl(szhp, entry.mnt_mountp,
MS_FORCE);
zfs_close(szhp);
}
}
}
Expand Down

0 comments on commit b508b29

Please sign in to comment.