nfs_clvnops: standardize on EOPNOTSUPP for posix_fallocate(2)

POSIX Issue 7 had allowed EINVAL for this case, but issue 8 moves it
to ENOTSUP instead.  ZFS uses the latter and we have some software in
ports already that's wanting to use that to detect the filesystem not
supporting it, so let's standardize on it.

Reviewed by:	imp, kib, rmacklem
Differential Revision:	https://reviews.freebsd.org/D53536
This commit is contained in:
Kyle Evans
2025-11-04 18:30:58 -06:00
parent fa393807c5
commit b87436d8be
+6 -2
View File
@@ -3896,11 +3896,15 @@ nfs_allocate(struct vop_allocate_args *ap)
mtx_lock(&nmp->nm_mtx);
nmp->nm_privflag |= NFSMNTP_NOALLOCATE;
mtx_unlock(&nmp->nm_mtx);
error = EINVAL;
error = EOPNOTSUPP;
}
} else {
/*
* Pre-v4.2 NFS server that doesn't support it, or a newer
* NFS server that has indicated that it doesn't support it.
*/
mtx_unlock(&nmp->nm_mtx);
error = EINVAL;
error = EOPNOTSUPP;
}
if (attrflag != 0) {
ret = nfscl_loadattrcache(&vp, &nfsva, NULL, 0, 1);