libzfs: scrub: only include start and end nv pairs if needed for scrub#18314
Merged
behlendorf merged 1 commit intoopenzfs:masterfrom Mar 12, 2026
Merged
Conversation
This patch addresses running `zpool scrub <pool>` with ZFS 2.4 userspace while the loaded kernel module is still 2.3, failing with: ``` cannot scrub <pool>: the loaded zfs module does not support an option for this operation. A reboot may be required to enable this option. ``` Checking for the source of the message via `strace` showed the scrub ioctl failing and setting errno to ZFS_ERR_IOC_ARG_UNAVAIL[0]. With that and the comments in `module/zfs/zfs_ioctl.c`[1] commit: 894edd0 seemed like a likely cause for the backward incompatibility. The corresponding kernelspace code in `module/zfs/zfs_ioctl.c` defaults to a setting of 0 if either parameter is not set, so not providing the nvpairs in case both are 0 should not make a semantic difference. Tested by: * loading zfs.ko in version 2.3.6 * running `zpool scrub testpool` with zpool from master (error occurs) * running `zpool scrub testpool` with this patch applied (scrub is started) This should help users who are still stuck on an older kernel module, while their distribution ships newer ZFS userspace. This was observed in the Proxmox community forum: https://forum.proxmox.com/threads/.180467/ [0] https://github.com/openzfs/zfs/blob/d35951b18d6e12afeb0d5b0539ff2467ab4bfbcf/include/sys/fs/zfs.h#L1762 [1] https://github.com/openzfs/zfs/blob/d35951b18d6e12afeb0d5b0539ff2467ab4bfbcf/module/zfs/zfs_ioctl.c#L7799 Fixes: 894edd0 ("Add TXG timestamp database") Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
behlendorf
approved these changes
Mar 12, 2026
Contributor
behlendorf
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the compatibility fix.
amotin
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This patch addresses running
zpool scrub <pool>with ZFS 2.4 userspace while the loaded kernel module is still 2.3, failing with:This should help users who are still stuck on an older kernel module, while their distribution ships newer ZFS userspace.
This was observed in the Proxmox community forum:
https://forum.proxmox.com/threads/.180467/
Description
Checking for the source of the message via
straceshowed the scrub ioctl failing and setting errno to ZFS_ERR_IOC_ARG_UNAVAIL[0]. With that and the comments inmodule/zfs/zfs_ioctl.c[1] commit: 894edd0 seemed like a likely cause for the backward incompatibility.The corresponding kernelspace code in
module/zfs/zfs_ioctl.cdefaults to a setting of 0 if either parameter is not set, so not providing the nvpairs in case both are 0 should not make a semantic difference.[0]
zfs/include/sys/fs/zfs.h
Line 1762 in d35951b
[1]
zfs/module/zfs/zfs_ioctl.c
Line 7799 in d35951b
Fixes: 894edd0 ("Add TXG timestamp database")
How Has This Been Tested?
Tested by:
zpool scrub testpoolwith zpool from master (error occurs)zpool scrub testpoolwith this patch applied (scrub is started)Types of changes
Checklist:
Signed-off-by.