Skip to content

ZVOL: Make zvol_volmode module parameter platform-independent #17386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuporovvStack
Copy link
Contributor

Motivation and Context

Unify ZFS kernel module parameters names between Linux and FreeBSD.

Description

Make zvol_volmode module parameter unification between Linux and FreeBSD.

The parameter have two entries in the sysctls list on FreeBSD side:

  • 'vfs.zfs.vol.mode' - old sysctl name.
  • 'vfs.zfs.zvol_volmode' - new one, compatible with Linux.

The sysctl old name is preserved for backward compatibility, if used somewhere by ZFS users or by 3rd party software.

How Has This Been Tested?

No additional tests added.

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)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • 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:

@amotin amotin added the Status: Code Review Needed Ready for review and testing label May 27, 2025
The module parameter name was not changed in FreeBSD sysctls
list: 'vfs.zfs.vol.mode'. Also, on Linux side the name is:
/sys/module/zfs/parameters/zvol_volmode.

Sponsored-by: vStack, Inc.
Signed-off-by: Fedor Uporov <[email protected]>
@fuporovvStack fuporovvStack force-pushed the zvol-small-compatibility-fixes-zvol_volmode branch from 610bb79 to 954e23e Compare May 28, 2025 19:28
@fuporovvStack
Copy link
Contributor Author

@robn, thank you for explanation. I've updated this PR accordingly.
Now the sysctl name on FreeBSD side could be preserved:

$ sysctl vfs.zfs.vol.mode
vfs.zfs.vol.mode: 1

On Linux side, same as you provided above:

/sys/module/zfs/parameters/zvol_volmode 
1

Both other PR's are updated by the same way:
#17384
#17385

Also, I should not forget to fix my previous PR to make all these sysctls compatible:
#17169

Copy link
Member

@robn robn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, nice work!

@amotin amotin added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels May 29, 2025
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've missed that it failed CI on all Linux'es. We should remove this to not duplicate:

module_param(zvol_volmode, uint, 0644);
MODULE_PARM_DESC(zvol_volmode, "Default volmode property value");

@amotin amotin added Status: Revision Needed Changes are required for the PR to be accepted and removed Status: Accepted Ready to integrate (reviewed, tested) labels May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Revision Needed Changes are required for the PR to be accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants