summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into fixupfixupNikolaus Rath2023-04-042-5/+90
|\
| * Workaround musl bug when mountdir has whitespace (#761)Matthias Görgens2023-04-022-5/+90
| | | | | | Fixes https://github.com/libfuse/libfuse/issues/634 and https://github.com/mpartel/bindfs/issues/106
| * Fix compiler warning in hello_ll.c (#760)Nikolaus Rath2023-04-011-2/+4
| |
* | Document risks of auto_unmount.Nikolaus Rath2023-04-041-0/+15
| |
* | Fix compiler warning in hello_ll.cNikolaus Rath2023-04-011-2/+4
|/
* Add unit tests for setxattr() et alNikolaus Rath2023-04-012-8/+65
| | | | Hopefully, this will catch issues as in commit 024eccbf3
* Fix typos and configure spellcheck for PRsYaroslav Halchenko2023-03-299-8/+38
|
* Fix meson deprecation warningMatthias Goergens2023-03-291-1/+1
| | | | | | | | | | When running `meson ..` I get: ``` WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated. ``` So let's fix this in the docs.
* Fix use-after-free warningMatthias Goergens2023-03-281-1/+2
| | | | | | | | | | | | | | | | | | | | When building, I get the following warning: ```bash $ ninja [18/71] Compiling C object lib/libfuse3.so.3.14.1.p/modules_iconv.c.o ../lib/modules/iconv.c: In function ‘iconv_convpath’: ../lib/modules/iconv.c:85:38: warning: pointer ‘newpath’ may be used after ‘realloc’ [-Wuse-after-free] 85 | p = tmp + (p - newpath); | ~~~^~~~~~~~~~ ../lib/modules/iconv.c:80:31: note: call to ‘realloc’ here 80 | tmp = realloc(newpath, newpathlen + 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [71/71] Linking target example/passthrough_hp ``` It's a false positive, I thinks. But it's also easy to silence this warning with a small refactor.
* Review feedback: rename and commentsMatthias Goergens2023-03-281-3/+9
|
* Fix `auto_unmount` to work without `allow_other`Matthias Goergens2023-03-281-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | In https://github.com/libfuse/libfuse/blob/77d662459a0fcdf358d515477d33795837e859d5/util/fusermount.c#L1219 `open` is executed as root which does not have access to the mount point if `allow_other` was not used and the real user id is not 0. Since `allow_other` usually cannot be specified by unprivileged users, `auto_unmount` has no effect for unprivileged users. In this commit, we work around this limitation: We first try to open the mountpoint as root, and if we get `EACCES`, we retry as the user who started fusermount, and see if we get `ENOTCONN`. In my testing, I found that `setfsuid` and `setfsgid` don't work to get around the lack of `allow_other`. (Sorry, I don't know enough about the Linux kernel to tell whether that's significant.) As a workaround, I decided to use `setresuid` and `setresgid` in a forked child process, and communicate via its exit status. Please give feedback on correctness, style and suggest tests. Fixes https://github.com/libfuse/libfuse/issues/586
* Update script to drop references to Travis CI.Nikolaus Rath2023-03-261-3/+3
|
* Released 3.14.1fuse-3.14.1Nikolaus Rath2023-03-263-1/+15
|
* Revert "upgrade of fuse_kernel.h based on Miklos expire_only kernel patch ↵Nikolaus Rath2023-03-261-190/+11
| | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?h=for-next&id=53e949edb7692dce02220eba926c9d75ecbb47f7" This reverts commit 7f430a39db5a30979d75a906af891a38ebce1a3c because it breaks setxattr(). Fixes: #730
* Add more time mount options to fusermount / fix lazytimeBernd Schubert2023-03-202-2/+10
| | | | | Previous patch had forgotten fusermount. And also had "lazyatime" instead of "lazytime".
* Add more time mount optionsBernd Schubert2023-03-191-0/+16
| | | | | These are especially needed for xfstests, but also useful in general.
* Respect includedir when installing libfuse_config.hHeiko Becker2023-03-121-1/+1
|
* Fix max_threads command line parameter propagationSarath Lakshman2023-03-111-0/+1
| | | | | | The fuse_main_real() method doesn't apply the max_threads parameter parsed through the commandline arguments. This commit fixes the wiring of max_threads argument.
* Enable parallel direct writes on the same file.Dharmendra singh2023-03-035-4/+32
| | | | | | | | | | | | | | | | | | | Right now fuse kernel serializes direct writes on the same file. This serialization is good for such FUSE implementations which rely on the inode lock to avoid any data inconsistency issues but it hurts badly such FUSE implementations which have their own mechanism of dealing with cache/data integrity and can handle parallel direct writes on the same file. This patch allows parallel direct writes on the same file to be enabled with the help of a flag FOPEN_PARALLEL_DIRECT_WRITES. FUSE implementations which want to use this feature can set this flag during fuse init. Default behaviour remains same i.e no parallel direct writes on the same file. Corresponding fuse kernel patch(Merged). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2&id=153524053bbb0d27bb2e0be36d1b46862e9ce74c
* Update description of keep_cache.Nikolaus Rath2023-03-011-5/+4
|
* Migrate from Travis to Github actionsNikolaus Rath2023-02-204-29/+8
| | | | | With current Ubuntu, Valgrind apparently does not like clang debug info, so do not run valgrind with clang-compiled binaries.
* Avoid max-idle threads warningBernd Schubert2023-02-202-5/+6
| | | | | | | | | | | | | | | If a program with API before 312 did not set max_idle_threads the new default from fuse_parse_cmdline_312() is applied, which sets UINT_MAX (-1). Later in compat fuse_session_loop_mt_32 the old config v1 struct is converted and that conversion prints a warning if the default unset value was used. This could have also happened to programs using the current API, which just apply values struct fuse_cmdline_opts, without checking if the defaults are set.
* Change define for C++ tooPierre Labastie2023-02-201-1/+1
| | | | | Commit d7560cc has split defines into private and public, and passed -DHAVE_LIBFUSE-PRIVATE_CONFIG_H to all C programs. But the arguments of C++ programs have not been changed. This leads to a test failure as reported in issue #734. Pass -DHAVE_LIBFUSE-PRIVATE_CONFIG_H to C++ programs too. Fixes: #734
* Add a github actions fileBernd Schubert2023-02-201-0/+26
| | | | | converted from travis with _sligh_ editing by https://akx.github.io/travis-to-github-actions/
* Released 3.14.0fuse-3.14.0Nikolaus Rath2023-02-174-2/+13
|
* fuse_lowlevel.h: add more setattr flagsXiubo Li2023-02-092-0/+10
| | | | | | | | | | | Such as for the xfstest-dev's generic/684 test case it will clear suid and sgid if the fallocate request is commited by an unprivileged user. The kernel fuse passed the ATTR_KILL_SUID/ATTR_KILL_SGID flags to userspace but it will be dropped. Signed-off-by: Xiubo Li <xiubli@redhat.com>
* Split config.h into private and public configBernd Schubert2023-02-097-24/+46
| | | | | | | | | | | | | | | | | | | | | | This addresses https://github.com/libfuse/libfuse/issues/729 commit db35a37def14b72181f3630efeea0e0433103c41 introduced a public config.h (rename to fuse_config.h to avoid conflicts) that was installed with the package and included by libfuse users through fuse_common.h. Probablem is that this file does not have unique defines so that they are unique to libfuse - on including the file conflicts with libfuse users came up. In principle all defines could be prefixed, but then most of them are internal for libfuse compilation only. So this splits out publically required defines to a new file 'libfuse_config.h' and changes back to include of "fuse_config.h" only when HAVE_LIBFUSE_PRIVATE_CONFIG_H is defined. This also renames HAVE_LIBC_VERSIONED_SYMBOLS to LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS, as it actually better explains for libfuse users what that variable is for.
* Released 3.13.1fuse-3.13.1Nikolaus Rath2023-02-033-1/+9
|
* Install a the configure_file (config.h) and use in headersBernd Schubert2023-01-2829-42/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This addresses: https://github.com/libfuse/libfuse/issues/724 HAVE_LIBC_VERSIONED_SYMBOLS configures the library if to use versioned symbols and is set at meson configuration time. External filesystems (the main target, actually) include fuse headers and the preprocessor then acts on HAVE_LIBC_VERSIONED_SYMBOLS. Problem was now that 'config.h' was not distributed with libfuse and so HAVE_LIBC_VERSIONED_SYMBOLS was never defined with external tools and the preprocessor did the wrong decision. This commit also increases the the minimal meson version, as this depends on meson feature only available in 0.50 <quote 'meson' > WARNING: Project specifies a minimum meson_ version '>= 0.42' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'} </quote> Additionally the config file has been renamed to "fuse_config.h" to avoid clashes - 'config.h' is not very specific.
* Update travis to ubuntu jammy (22.04)Bernd Schubert2023-01-282-8/+5
| | | | | A newer ubuntu version is required to get a more recent meson (at least 0.50 now)
* use off_t over __off64_tpsykose2023-01-152-6/+6
| | | | | | | | | when -D_FILE_OFFSET_BITS=64 is defined, the off_t type is 64 bits wide already. the fuse_common.h header already checks for this, and errors when it is not, so be consistent with all the other uses of off_t. some libcs like musl do not have a 32-bit off_t type, and don't define __off64_t.
* Released 3.13.0fuse-3.13.0Nikolaus Rath2023-01-134-4/+20
|
* passthrough_hp: Avoid a bit code dup in readdirBernd Schubert2023-01-131-14/+9
| | | | Just a slight code simplification.
* passthrough_hp: Add options for clone_fd, max_threads, daemonizeBernd Schubert2023-01-133-2/+40
| | | | | | | This is useful for benchmarking. Note: This changes behavior - passthrough_hp runs in background by default now.
* Fix loading of FUSE modulesGoswin von Brederlow2023-01-131-3/+3
| | | | | | | | | | | | | dlsym returns the address of the module factory symbol, not the actual function (#722) pointer. Change the type of `factory` to `fuse_module_factory_t*` to reflect this and then dereference it when registering the module. This is a followup to d92bf83, which introduced a NULL pointer dereference when dlsym returns NULL, and 8ec7fd9, which reverted it back to not dereferencing the symbol at all. Fixes: #721 Co-authored-by: Goswin von Brederlow <brederlo@q-leap.de>
* Support application-defined I/O functions for FUSE fdTofik Sonono2023-01-109-13/+567
| | | | | | The io for FUSE requests and responses can now be further customized by allowing to write custom functions for reading/writing the responses. This includes overriding the splice io. The reason for this addition is that having a custom file descriptor is not sufficient to allow custom io. Different types of file descriptor require different mechanisms of io interaction. For example, some file descriptor communication has boundaries (SOCK_DGRAM, EOF, etc...), while other types of fd:s might be unbounded (SOCK_STREAMS, ...). For unbounded communication, you have to read the header of the FUSE request first, and then read the remaining packet data. Furthermore, the one read call does not necessarily return all the data expected, requiring further calls in a loop.
* Test for fuse_lowlevel_notify_expire_entry.HereThereBeDragons2023-01-062-6/+22
| | | | This test is too simple to check for all functionalities of notify_expire as it always successfully passes when libfuse supports the function (even if kernel does not support it - it just takes it as notify_inval)
* adding comments and capability discovery, enum for flags moved to top of fileHereThereBeDragons2023-01-064-4/+56
|
* upgrade of fuse_kernel.h based on Miklos expire_only kernel patch ↵HereThereBeDragons2023-01-061-11/+190
| | | | https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?h=for-next&id=53e949edb7692dce02220eba926c9d75ecbb47f7
* Initial patch provided by Miklos Szeredi <mszeredi@redhat.com>HereThereBeDragons2023-01-064-5/+30
|
* Fixes when HAVE_LIBC_VERSIONED_SYMBOLS is not definedBernd Schubert2023-01-043-8/+42
| | | | | | | | | fuse_loop_mt and fuse_new had not been defined when HAVE_LIBC_VERSIONED_SYMBOLS had not been set and additionally, fuse_new_31 was missing in the version script and was therefore an unusable symbol. This also adds a test for unset HAVE_LIBC_VERSIONED_SYMBOLS.
* convert __APPLE__ and __ULIBC__ to HAVE_LIBC_VERSIONED_SYMBOLSBernd Schubert2023-01-045-25/+58
| | | | | | | | | | | In fact only gnu-libc fully supports symbol versioning, so it is better to have a generic macro for it. This also allows to manually disable symbol version and allows to run tests with that configuration on gnu-libc. That testing will still not catch compat issues, but least ensures the code can compile. Testing for __APPLE__ and __ULIBC__ is now done by meson. More of such checks can be added by people using other libcs.
* Fix ublic/apple build for the fuse_parse_cmdline ABI symbolBernd Schubert2023-01-043-13/+57
| | | | | | | | | | For __APPLE__ and __ULIBC__, which are assumed to not support versioned symbols, helper.c has a compat ABI symbol for fuse_parse_cmdline(). However that ABI symbol was conflicting with the API macro (which redirects to the right API function for recompilations against current libfuse). Additionally the parameter 'opts' had a typo and was called 'out_opts'.
* Remove partial locking of paths when using high-level APIKyle Lippincott2023-01-041-54/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in https://github.com/libfuse/libfuse/issues/695 and below, partial locking of paths can cause a deadlock. Partial locking was added to prevent starvation, but it's unclear what specific cases of starvation were of concern. As far as I was able to determine, since we support reader locks that give priority to writers (to prevent starvation), this means that to starve the queue element, we'd need a constant stream of queued requests that lock the path for write. Write locks are used when the element is being (potentially) removed, so this stream of requests that starve the `rename` or `lock` operations seems unlikely. ### Summarizing issue #695 The high-level API handles locking of the node structures it maintains to prevent concurrent requests from deleting nodes that are in use by other requests. This means that requests that might remove these structs (`rmdir`, `rename`, `unlink`, `link`) need to acquire an (internally managed - not pthread) exclusive lock before doing so. In the case where the lock is already held (for read or for write), the operation is placed onto a queue of waiters. On every unlock, the queue is reinspected for any element that might now be able to make progress. Since `rename` and `link` involve two paths, when added to the queue, a single queue entry requires that we lock two different paths. There was, prior to this change, support for partially locking the first queue element if it had two paths to lock. This partial locking can cause a deadlock: - set up a situation where the first element in the queue is partially locked (such as by holding a reader lock on one of the paths being renamed, but not the other). For example: `/rmthis/foo/foo.txt` [not-yet-locked] and `/rmthis/bar/bar.txt` [locked] - add an `rmdir` for an ancestor directory of the not-yet-locked path to the queue. In this example: `/rmthis` After getting into this situation, we have the following `treelock` values: - `/rmthis`: 1 current reader (due to the locked `/rmthis/bar/bar.txt`), one waiting writer (`rmdir`): no new readers will acquire a read lock here. - `/rmthis/bar`: 1 reader (the locked `/rmthis/bar/bar.txt`) - `/rmthis/bar/bar.txt`: 1 writer (the locked `/rmthis/bar/bar.txt`) This is deadlocked, because the partial lock will never be able to be completely locked, as doing so would require adding a reader lock on `/rmthis`, and that will be rejected due to write lock requests having priority -- until the writer succeeds in locking it, no new readers can be added. However, the writer (the `rmdir`) will never be able to acquire its write lock, as the reader lock will never be dropped -- there's no support for downgrading a partially locked element to be unlocked, the only state change that's allowed involves it becoming completely locked.
* Move try_get_path2 earlier in the fileKyle Lippincott2023-01-041-21/+21
|
* Revert "libfuse custom communication interface"Nikolaus Rath2023-01-023-24/+0
| | | | This reverts commit 777663953382925c7403f0560c28ec9bbd14d7be.
* update mount.c, in order to pass through -n.Ciaran2023-01-021-0/+1
| | | | autofs uses automount, which calls fuse, during an sshfs call. fuse complains about -n being an unknown option (ref. https://github.com/libfuse/libfuse/issues/715) this one line edit provides the command to be accepted, and pass through, allowing autofs-automount to operate on the mount, even though it is already in the mtab, given the nature of autofs/automount.
* Make it work even if max_idle_threads is set to 0Zhansong Gao2022-12-011-1/+1
| | | | | | | | | It may happen that none of the worker threads are running if max_idle_threads is set to 0 although few people will do this. Adding a limit of keeping at least one worker thread will make our code more rigorous. Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
* libfuse custom communication interfacey2022-11-153-0/+24
| | | | libfuse can now be used without having a mount interface.
* Fix the fuse_parse_cmdline@FUSE_3.0 ABI compat symbolBernd Schubert2022-09-111-1/+1
| | | | | | | | | There was a simple typo and sym1 didn't match the function name with the older __asm__(".symver " sym1 "," sym2) way to define ABI compatibility. Witht the newer "__attribute__ ((symver (sym2)))" sym1 is not used at all and in manual testing the issue didn't come up therefore.