Skip to content
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

FreeBSD: Add setting of the VFCF_FILEREV flag #16976

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

rmacklem
Copy link
Contributor

@rmacklem rmacklem commented Jan 22, 2025

The flag VFCF_FILEREV was recently defined in FreeBSD so that a file system could indicate that it increments va_filerev by one for each change.

Since ZFS does do this, set the flag if defined for the kernel being built. This allows the NFSv4.2 server to reply with the correct change_attr_type attribute value.

Motivation and Context

FreeBSD has a recently created file system flag called VFCF_FILEREV that indicates
that the file system increments va_filerev by one for each change. This flag is used
by the FreeBSD NFSv4.2 server to return the correct value for the change_attr_type
NFSv4.2 attribute.

Since ZFS does increment va_filerev by one, set the flag.

Description

Set the VFCF_FILEREV flag, if it is defined.
The #ifdef was changed so that it handles multiple flags that might be defined
in the FreeBSD kernel.

How Has This Been Tested?

Tested in a FreeBSD system running a NFSv4.2 server and exporting a ZFS file system.
A packet trace showed that the correct value for change_attr_type was returned to
the client for a NFSv4.2 mount.

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)
  • [x ] 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:

  • [x ] My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • [x ] All commit messages are properly formatted and contain Signed-off-by.

Add the VFCF_FILEREV flag

The flag VFCF_FILEREV was recently defined in FreeBSD
so that a file system could indicate that it increments
va_filerev by one for each change.

Since ZFS does do this, set the flag if defined for the
kernel being built.  This allows the NFSv4.2 server to
reply with the correct change_attr_type attribute value.
@amotin amotin changed the title Signed-off-by: Rick Macklem <[email protected]> Add setting of the VFCF_FILEREV flag Jan 22, 2025
@amotin amotin changed the title Add setting of the VFCF_FILEREV flag FreeBSD: Add setting of the VFCF_FILEREV flag Jan 22, 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.

Looks good to me. Just "Signed-off-by" line should be at the end of commit message, not in front of it. You can fix it via amending the commit and force-pushings.

@amotin amotin added the Status: Accepted Ready to integrate (reviewed, tested) label Jan 22, 2025
@amotin amotin merged commit 3420571 into openzfs:master Jan 23, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants