FreeBSD installed from FreeBSD-16.0-CURRENT-amd64-20260302-5d9b185c33ae-284268-disc1.iso NFSv4.1 client trying to set |FATTR4_ARCHIVE| gets EPERM for file/dir creation attempts. This looks like a variation of https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292283 ("Bug 292283 - (JAVA) NFSv4.1 client trying to set FATTR4_SYSTEM or FATTR4_HIDDEN gets EPERM for file and dir creation attemps"), since the same workaround in the Windows ms-nfs41-client NFSv4.1 client works if extended to |FATTR4_ARCHIVE| - see https://github.com/kofemann/ms-nfs41-client/commit/7156d9f9deb25843e57fd455d8ec67951b82c737
Rick do you have any suggestions?
Created attachment 268667 [details] nfs_nfsdserv.c: Fix handling of archive flag for mkdir, mknod, symlink This patch should fix the problem. I think you'll find Open/Create already works for "archive" if you have a FreeBSD server based on main (FreeBSD16). (I don't think archive support made it in FreeBSD-15.0.) If the reporter can test this fix, that would be nice. I will be committing this patch to main soon and MFC'ng it in time for FreeBSD-15.1.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6580d040861dfbf6c630a93cbf41f2a2c7e7b327 commit 6580d040861dfbf6c630a93cbf41f2a2c7e7b327 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2026-03-16 23:22:37 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2026-03-16 23:22:37 +0000 nfs_nfsdserv.c: Fix handling of archive flag for mkdir An NFSv4.1/4.2 client can set/clear the archive, hidden and system flags when creating non-regular files, such as directories. Without this patch, the setting of va_flags causes an EPERM failure, since they are specified for VOP_MKDIR(), VOP_MKNOD() and VOP_SYMLINK(). This patch sets va_flags == VNOVAL for the above VOP_xxx() calls and then sets/clears the flags after creation, which fixes the problem. This bug only affects the Windows NFSv4.1/4.2 client. PR: 293691 Tested by: Dan Shelton <dan.f.shelton@gmail.com> MFC after: 2 weeks sys/fs/nfsserver/nfs_nfsdserv.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
The patch has been committed to main and will be MFC'd in time for the FreeBSD-15.1 release.
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=cea122acd9beeae5a815733614a77acd60a87899 commit cea122acd9beeae5a815733614a77acd60a87899 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2026-03-16 23:22:37 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2026-03-31 01:05:42 +0000 nfs_nfsdserv.c: Fix handling of archive flag for mkdir An NFSv4.1/4.2 client can set/clear the archive, hidden and system flags when creating non-regular files, such as directories. Without this patch, the setting of va_flags causes an EPERM failure, since they are specified for VOP_MKDIR(), VOP_MKNOD() and VOP_SYMLINK(). This patch sets va_flags == VNOVAL for the above VOP_xxx() calls and then sets/clears the flags after creation, which fixes the problem. This bug only affects the Windows NFSv4.1/4.2 client. PR: 293691 (cherry picked from commit 6580d040861dfbf6c630a93cbf41f2a2c7e7b327) sys/fs/nfsserver/nfs_nfsdserv.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
(In reply to commit-hook from comment #5) In which FreeBSD 15.x release is this fixed ?
(In reply to commit-hook from comment #3) @rick: Thank you for fixing this!