aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2025-11-05 00:30:58 +0000
committerKyle Evans <kevans@FreeBSD.org>2025-11-05 00:30:58 +0000
commitb87436d8be8ea3f6d56c16d32933c138fed3fb12 (patch)
treec74e05efb6e92fa6fb5aec84f04873c01bcb0a19
parentfa393807c57e80a01dde40c668650537490c1eaa (diff)
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
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 795a8d106051..193d8b6cd5eb 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -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);