Date: Wed, 5 Nov 2025 00:31:16 GMT From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: b87436d8be8e - main - nfs_clvnops: standardize on EOPNOTSUPP for posix_fallocate(2) Message-ID: <202511050031.5A50VGMf028325@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b87436d8be8ea3f6d56c16d32933c138fed3fb12 commit b87436d8be8ea3f6d56c16d32933c138fed3fb12 Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2025-11-05 00:30:58 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2025-11-05 00:30:58 +0000 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 --- sys/fs/nfsclient/nfs_clvnops.c | 8 ++++++-- 1 file 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);help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202511050031.5A50VGMf028325>
