From 34205715e1544d343f9a64149b17c371282306ae Mon Sep 17 00:00:00 2001 From: rmacklem <64620010+rmacklem@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:33:43 -0800 Subject: [PATCH] FreeBSD: Add setting of 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. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Rick Macklem Closed #16976 --- module/os/freebsd/zfs/zfs_vfsops.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index a3fac1636981..a367ea8e508a 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -144,12 +144,14 @@ struct vfsops zfs_vfsops = { .vfs_quotactl = zfs_quotactl, }; +VFS_SET(zfs_vfsops, zfs, VFCF_DELEGADMIN | VFCF_JAIL #ifdef VFCF_CROSS_COPY_FILE_RANGE -VFS_SET(zfs_vfsops, zfs, - VFCF_DELEGADMIN | VFCF_JAIL | VFCF_CROSS_COPY_FILE_RANGE); -#else -VFS_SET(zfs_vfsops, zfs, VFCF_DELEGADMIN | VFCF_JAIL); + | VFCF_CROSS_COPY_FILE_RANGE +#endif +#ifdef VFCF_FILEREVINC + | VFCF_FILEREVINC #endif +); /* * We need to keep a count of active fs's.