aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2026-06-18 00:30:29 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2026-06-18 00:34:57 +0000
commit572680712c317b81d66475203ac1b9d6bbeca5d5 (patch)
treed9b6144b0c6a5705d3f0ab2b989f7ac04372491a
parentbb14ba3777bb201abd6d4dfbf67d70b81f9c1e97 (diff)
nfs_clvnops.c: Fix the case where va_flags are being cleared
Commits c5d72d2 and 3b6d4c6 broke the case where the archive/hidden/system attributes are being set false (UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.) and the NFS server does not support those attributes. These patches only checked for support if the archive/hidden/system attributes were non-zero. This patch fixes the problem. PR: 296088 Tested by: Joshua Kinard <freebsd@kumba.dev> MFC after: 1 week Fixes: c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes")
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 26aa6491ac4a..5081e442882e 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -1033,12 +1033,9 @@ nfs_setattr(struct vop_setattr_args *ap)
nmp = VFSTONFS(vp->v_mount);
if (vap->va_flags != VNOVAL && (!NFSHASNFSV4(nmp) ||
(vap->va_flags & ~(UF_ARCHIVE | UF_HIDDEN | UF_SYSTEM)) != 0 ||
- ((vap->va_flags & UF_ARCHIVE) != 0 &&
- !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_ARCHIVE)) ||
- ((vap->va_flags & UF_HIDDEN) != 0 &&
- !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_HIDDEN)) ||
- ((vap->va_flags & UF_SYSTEM) != 0 &&
- !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_SYSTEM))))
+ !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_ARCHIVE) ||
+ !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_HIDDEN) ||
+ !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_SYSTEM)))
return (EOPNOTSUPP);
/*