freebsd-src/sys/fs/fuse
Alan Somers 6efba04df3 fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE
Background:

If a user does pathconf(_, _PC_MIN_HOLE_SIZE) on a fusefs file system,
the kernel must actually issue a FUSE_LSEEK operation in order to
determine whether the server supports it.  We cache that result, so we
only have to send FUSE_LSEEK the first time that _PC_MIN_HOLE_SIZE is
requested on any given mountpoint.

Problem 1:

Unlike fpathconf, pathconf operates on files that may not be open.  But
FUSE_LSEEK requires the file to be open.  As described in PR 278135,
FUSE_LSEEK cannot be sent for unopened files, causing _PC_MIN_HOLE_size
to wrongly report EINVAL.  We never noticed that before because the
fusefs test suite only uses fpathconf, not pathconf.  Fix this bug by
opening the file if necessary.

Problem 2:

On a completely sparse file, with no data blocks at all, FUSE_LSEEK with
SEEK_DATA would fail to ENXIO.  That's correct behavior, but
fuse_vnop_pathconf wrongly interpreted that as "FUSE_LSEEK not
supported".  Fix the interpretation.

PR:		278135
MFC after:	1 week
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D44618
2024-06-24 10:02:02 -06:00
..
fuse.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fuse_device.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
fuse_file.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
fuse_file.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fuse_internal.c fusefs: only test for incoherency if FN_SIZECHANGE is set 2024-02-08 20:13:24 -07:00
fuse_internal.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fuse_io.c Add vnode_pager_clean_{a,}sync(9) 2024-01-11 18:44:53 +02:00
fuse_io.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fuse_ipc.c fuse: Fix typo (triple S) 2023-12-27 20:24:32 -07:00
fuse_ipc.h fusefs: sanitize FUSE_READLINK results for embedded NULs 2023-10-07 08:22:03 -06:00
fuse_kernel.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fuse_main.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
fuse_node.c Stop treating size 0 as unknown size in vnode_create_vobject(). 2024-05-23 06:08:14 +00:00
fuse_node.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fuse_vfsops.c Stop treating size 0 as unknown size in vnode_create_vobject(). 2024-05-23 06:08:14 +00:00
fuse_vnops.c fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE 2024-06-24 10:02:02 -06:00