Skip to content

Commit

Permalink
Tighten ptr use in case sensitive
Browse files Browse the repository at this point in the history
fix vol BSOD as well
  • Loading branch information
lundman committed Jan 11, 2023
1 parent c01313d commit fd9924d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions module/os/windows/zfs/zfs_vnops_windows_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,11 @@ file_basic_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,

// This can be called from diskDispatcher, referring to the volume.
// if so, make something up. Is this the right thing to do?
#if 0
if (IrpSp->FileObject && IrpSp->FileObject->FsContext == NULL) {
mount_t *zmo;
zfsvfs_t *zfsvfs = vfs_fsprivate(zmo);
// BAD, zmo is undef above
LARGE_INTEGER JanOne1980 = { 0xe1d58000, 0x01a8e79f };
ExLocalTimeToSystemTime(&JanOne1980,
&basic->LastWriteTime);
Expand All @@ -2783,8 +2787,8 @@ file_basic_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,
Irp->IoStatus.Information = sizeof (FILE_BASIC_INFORMATION);
return (STATUS_SUCCESS);
}

ASSERT(basic->FileAttributes != 0);
#endif
// ASSERT(basic->FileAttributes != 0);
dprintf(" %s failing\n", __func__);
return (STATUS_OBJECT_NAME_NOT_FOUND);
}
Expand Down Expand Up @@ -3072,17 +3076,21 @@ file_case_sensitive_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,
return (STATUS_BUFFER_TOO_SMALL);
}

struct vnode *vp = FileObject->FsContext;
fcsi->Flags = 0;

znode_t *zp = VTOZ(vp);
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
struct vnode *vp = FileObject->FsContext;
if (vp != NULL) {
znode_t *zp = VTOZ(vp);
if (zp != NULL) {
zfsvfs_t *zfsvfs = zp->z_zfsvfs;

fcsi->Flags = 0;
if (zfsvfs->z_case == ZFS_CASE_SENSITIVE)
fcsi->Flags |= FILE_CS_FLAG_CASE_SENSITIVE_DIR;
if (zfsvfs->z_case == ZFS_CASE_SENSITIVE)
fcsi->Flags |= FILE_CS_FLAG_CASE_SENSITIVE_DIR;

Irp->IoStatus.Information = sizeof (FILE_CASE_SENSITIVE_INFORMATION);
}
}

Irp->IoStatus.Information = sizeof(FILE_CASE_SENSITIVE_INFORMATION);
return (STATUS_SUCCESS);
}

Expand Down

0 comments on commit fd9924d

Please sign in to comment.