Skip to content

Commit

Permalink
FILE_OPEN_BY_FILE_ID can be 16 bytes
Browse files Browse the repository at this point in the history
When the open comes with an ObjectID it is
16 bytes.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Apr 3, 2024
1 parent 4a3df8d commit 91d2dd5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions module/os/windows/zfs/zfs_vnops_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,14 @@ zfs_vnop_lookup_impl(PIRP Irp, PIO_STACK_LOCATION IrpSp, mount_t *zmo,
BooleanFlagOn(Options, FILE_OPEN_REPARSE_POINT);


// Should be passed an 8 byte FileId instead.
if (FileOpenByFileId && FileObject->FileName.Length !=
sizeof (ULONGLONG))
return (STATUS_INVALID_PARAMETER);
// Should be passed an 8/16 byte FileId instead.
if (FileOpenByFileId) {
if (FileObject->FileName.Length !=
sizeof (ULONGLONG) &&
FileObject->FileName.Length !=
sizeof (FILE_ID_128))
return (STATUS_INVALID_PARAMETER);
}

TemporaryFile = BooleanFlagOn(IrpSp->Parameters.Create.FileAttributes,
FILE_ATTRIBUTE_TEMPORARY);
Expand Down Expand Up @@ -1107,8 +1111,11 @@ zfs_vnop_lookup_impl(PIRP Irp, PIO_STACK_LOCATION IrpSp, mount_t *zmo,

}

} else { // Open By File ID
} else { // Open By File ID FileOpenByFileId

// Filename.Length is 16 (ObjectID) should we
// verify the VolumeID matches? Lookup VolumeID?
// or can we rely on zfsvfs being correct?
error = zfs_zget(zfsvfs,
*((uint64_t *)IrpSp->FileObject->FileName.Buffer), &zp);
// Code below assumed dvp is also , so we need to
Expand Down

0 comments on commit 91d2dd5

Please sign in to comment.