Skip to content

Commit

Permalink
Build mountpoint was incorrect
Browse files Browse the repository at this point in the history
BOOM/games/scifi would attempt to mount lowest at
E:/scifi instead of the correct E:/games/scifi.

More work was needed to build the mountpoint

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Jan 23, 2024
1 parent a06dbe5 commit f85bf35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/libzfs/os/windows/libzfs_mount_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ do_mount(zfs_handle_t *zhp, const char *dir, const char *optptr, int mflag)
entry.mnt_special);
char *part = strstr(dir, parent);
if (part) dir = &part[strlen(parent) - 1];
snprintf(zc.zc_value, sizeof (zc.zc_value),
"\\??\\%s%s", entry.mnt_mountp, dir);
} else {
snprintf(zc.zc_value, sizeof (zc.zc_value),
"\\??\\%c:%s", tolower(driveletter[0]),
dir);
}

snprintf(zc.zc_value, sizeof (zc.zc_value),
"\\??\\%c:%s", tolower(driveletter[0]), dir);
}
} else {
/* snapshot */
Expand Down
9 changes: 8 additions & 1 deletion module/os/windows/zfs/zfs_vnops_windows_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,14 @@ zfs_vnop_mount(PDEVICE_OBJECT DiskDevice, PIRP Irp, PIO_STACK_LOCATION IrpSp)
SetNextDriveletterManually(mountmgr,
&dcb->device_name);
}
} // !MOUNTMGR_IS_DRIVE_LETTER(&actualDriveletter)
} else { // !MOUNTMGR_IS_DRIVE_LETTER(&actualDriveletter)

// mountpath is "/DosDevices/E:" but we need to
// save that in dcb, for future query.
FreeUnicodeString(&dcb->mountpoint);
RtlDuplicateUnicodeString(0, &mountpath,
&dcb->mountpoint);
}
} else {
OBJECT_ATTRIBUTES poa;
// 36(uuid) + 6 (punct) + 6 (Volume)
Expand Down

0 comments on commit f85bf35

Please sign in to comment.