From nobody Wed Nov 05 00:31:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4d1R835TqHz6FsBL; Wed, 05 Nov 2025 00:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d1R834w6Jz3fHD; Wed, 05 Nov 2025 00:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762302675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Or8KDT9AENW+sYNONQhEvoSqHXYomy4oSwrlSW5Htw=; b=wEvU2KNDWtHH37wsVDMxnUpiQPhZ1RThEROG71MGv9cN4VJxmrPCe6HoECERqum55yYM/g er02bnf9N8HuvnHJrddWPTjLPU3OqU26yvkzKj2BLAyERX4g4+q35VfPqrjw4HJaNGRdnI nRDrdgGEdK8RTswUVXvQ1ZsfbuGpq2w92JNcP0L3CcdE94gkZl8pRbbvu7pvh0z8d+F/NS qB0xy780HF+0SLImlRQOe6G8lMi0/mFGqFWl9VuP6IF5ubx6W4RejEf5rHR0X1sTpHs3dN 9L3cbEel8H0OILLmXGoHrJSv09IHdRG9OAyu+3n1rcwlnwxGvZ/8woD+B6ponw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762302675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Or8KDT9AENW+sYNONQhEvoSqHXYomy4oSwrlSW5Htw=; b=joB3dqp8XyK4wHmph23OmfcgT0Gq3Yf1gNeCR8fcyPSnjaMW644hnsNsZFAup4t6KEO1aF g5VztdblwRYkE6s7DPdjFbYmZia+6SIWU+4VUen9OBvGPbr92Ops5wuunfyRE0rBna2mo/ 4PVCcTIgKpPSREg4A2Mm3Crm7yvfb5kLJcb50O7rLmh2dlS5uF4AwK8gXc2I8WT3OTBx1N GLz6iJVfTlvEw0MmBTAKH8xfiC2ayySr4nFYyQ2MzTFq7z2tu/ELqmP8lJCx4cxCbGKcWq fF7duqxhu6WFk1e7Ns2lADYlMvITrzy0IYApQMTy6oyXthBPxWdutEowwZYVug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762302675; a=rsa-sha256; cv=none; b=Ej2CNilmzxQvAbNBMc53jzTi04K9wBfhDJkQye+rdqxQ+gVJXsWWno/NhRUZ+7rcWu5ezu 4zRb9q6J7IHPlaEOQ632cqcIwXm1n0T7Mouobn906pbnjDWSMlHBY5lkMrIIP3d44DJv/z PMZGapj4gkPdH0rLw9h8/Ik1nOFMzCv3ji/gmQ5vewhF5ExRr8/4dI5hqt0OvqjCadv7sx U+E4ow//OsGAECXG+mHmky5lUwvGOtkTeoqx/iyxfpPRgdaBJieK3H5PBR6gNP1L+UIepv 6lPk0Nmskf+SVdWvKvMzxiPNJ1Jgkf4WvSri1QqNJlJvYX/JL/6HfSurMILxFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4d1R834WWwz4yt; Wed, 05 Nov 2025 00:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5A50VFGN028294; Wed, 5 Nov 2025 00:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5A50VF09028291; Wed, 5 Nov 2025 00:31:15 GMT (envelope-from git) Date: Wed, 5 Nov 2025 00:31:15 GMT Message-Id: <202511050031.5A50VF09028291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: fa393807c57e - main - fusefs: standardize on OPNOTSUPP for posix_fallocate(2) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa393807c57e80a01dde40c668650537490c1eaa Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=fa393807c57e80a01dde40c668650537490c1eaa commit fa393807c57e80a01dde40c668650537490c1eaa Author: Kyle Evans AuthorDate: 2025-11-05 00:30:58 +0000 Commit: Kyle Evans CommitDate: 2025-11-05 00:30:58 +0000 fusefs: standardize on OPNOTSUPP 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 (previous version), asomers, kib Differential Revision: https://reviews.freebsd.org/D53535 --- sys/fs/fuse/fuse_vnops.c | 6 +++--- tests/sys/fs/fusefs/fallocate.cc | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 6c79e646d2f3..ef5aee5de34c 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -625,7 +625,7 @@ fuse_vnop_allocate(struct vop_allocate_args *ap) return (EROFS); if (fsess_not_impl(mp, FUSE_FALLOCATE)) - return (EXTERROR(EINVAL, "This server does not implement " + return (EXTERROR(EOPNOTSUPP, "This server does not implement " "FUSE_FALLOCATE")); io.uio_offset = *offset; @@ -656,14 +656,14 @@ fuse_vnop_allocate(struct vop_allocate_args *ap) if (err == ENOSYS) { fsess_set_notimpl(mp, FUSE_FALLOCATE); - err = EXTERROR(EINVAL, "This server does not implement " + err = EXTERROR(EOPNOTSUPP, "This server does not implement " "FUSE_ALLOCATE"); } else if (err == EOPNOTSUPP) { /* * The file system server does not support FUSE_FALLOCATE with * the supplied mode for this particular file. */ - err = EXTERROR(EINVAL, "This file can't be pre-allocated"); + err = EXTERROR(EOPNOTSUPP, "This file can't be pre-allocated"); } else if (!err) { *offset += *len; *len = 0; diff --git a/tests/sys/fs/fusefs/fallocate.cc b/tests/sys/fs/fusefs/fallocate.cc index 4e5b047b78b7..1a3a0af36236 100644 --- a/tests/sys/fs/fusefs/fallocate.cc +++ b/tests/sys/fs/fusefs/fallocate.cc @@ -205,7 +205,7 @@ TEST_F(Fspacectl, enosys) EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL)); /* Neither should posix_fallocate query the daemon */ - EXPECT_EQ(EINVAL, posix_fallocate(fd, off1, len1)); + EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, off1, len1)); leak(fd); } @@ -548,7 +548,7 @@ INSTANTIATE_TEST_SUITE_P(FspacectlCache, FspacectlCache, /* * If the server returns ENOSYS, it indicates that the server does not support - * FUSE_FALLOCATE. This and future calls should return EINVAL. + * FUSE_FALLOCATE. This and future calls should return EOPNOTSUPP. */ TEST_F(PosixFallocate, enosys) { @@ -570,10 +570,10 @@ TEST_F(PosixFallocate, enosys) fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); - EXPECT_EQ(EINVAL, posix_fallocate(fd, off0, len0)); + EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, off0, len0)); /* Subsequent calls shouldn't query the daemon*/ - EXPECT_EQ(EINVAL, posix_fallocate(fd, off0, len0)); + EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, off0, len0)); /* Neither should VOP_DEALLOCATE query the daemon */ EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL)); @@ -607,10 +607,10 @@ TEST_F(PosixFallocate, eopnotsupp) fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); - EXPECT_EQ(EINVAL, posix_fallocate(fd, fsize, length)); + EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, fsize, length)); /* Subsequent calls should still query the daemon*/ - EXPECT_EQ(EINVAL, posix_fallocate(fd, offset, length)); + EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, offset, length)); /* And subsequent VOP_DEALLOCATE calls should also query the daemon */ rqsr.r_len = length; @@ -759,7 +759,7 @@ TEST_F(PosixFallocate, rlimit_fsize) } /* With older servers, no FUSE_FALLOCATE should be attempted */ -TEST_F(PosixFallocate_7_18, einval) +TEST_F(PosixFallocate_7_18, eopnotsupp) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; @@ -773,7 +773,7 @@ TEST_F(PosixFallocate_7_18, einval) fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); - EXPECT_EQ(EINVAL, posix_fallocate(fd, offset, length)); + EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, offset, length)); leak(fd); }