Skip to content

zfs_vnops_windows: fix volume disk extent length - #586

Open
lideming wants to merge 1 commit into
openzfsonwindows:zfs-Windows-2.4.1-releasefrom
lideming:ldm/win-volume-size-ioctls
Open

zfs_vnops_windows: fix volume disk extent length#586
lideming wants to merge 1 commit into
openzfsonwindows:zfs-Windows-2.4.1-releasefrom
lideming:ldm/win-volume-size-ioctls

Conversation

@lideming

@lideming lideming commented Jun 3, 2026

Copy link
Copy Markdown

Targeted at zfs-Windows-2.4.1-release because it is the current zfswin-2.4.1rc11 release branch. Please let me know if development is preferred.

Motivation and Context

2c729121825bbedc769dead2a2a66147

(Task Manager showing the incorrect volume size before the fix)

The volume disk extent handler should report the same byte count used by the other disk and partition size handlers.

Description

Use refdbytes + availbytes for IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.

Also zero-initialize several disk geometry and partition output buffers before filling the fields OpenZFS returns.

How Has This Been Tested?

By Agent:

  • Tested on Windows Server 2022 with a test-signed x64 driver based on zfswin-2.4.1rc11.
  • Created a file-backed pool and encrypted dataset.
  • Wrote data, ran zpool sync, and verified SHA256 readback.
  • zpool status remained ONLINE with no known data errors.

By Human:

  • A test-signed rc10 build containing this change has been used on my daily-use Windows PC since 2026-05-13 with no observed issues. The corrected volume size path was also confirmed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Use refdbytes + availbytes for
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.

This matches the other disk and partition size handlers.  Also
zero-initialize several output buffers before filling the returned
fields.

Signed-off-by: lideming <me@yuuza.net>
@lundman

lundman commented Jun 4, 2026

Copy link
Copy Markdown

This looks great thanks. You used the correct branch, I go back and populate the Development branch periodically but haven't had the time lately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants