Commit Graph

1775 Commits

Author SHA1 Message Date
Andrew Gaul
b08e275083
Fix ReST end-string nits (#638)
This makes the file more readable with syntax highlighting.
2022-01-23 10:17:03 +00:00
Ken Schalk
6ddd14f2b1
Avoid ENOENT response when recently invalidated fuse_ino_t is received from the kernel (#636) 2022-01-11 19:56:36 +00:00
Maximilian Heinzler
48ae2e72b3
Document possible NULL paths when directories are removed (#633)
When directories with open handles are removed, the releasedir and
fsyncdir operations might be called with a NULL path. That is because
there is no hiding behavior like for regular files and the nodes get
removed immediately.
2021-12-12 16:28:57 +00:00
Luis Henriques
cee6de8d66
test/test_syscalls.c: allow EBADF in fcheck_stat() (#631)
Test test/test_examples.py::test_passthrough_hp[False] fails because, on
kernels >= 5.14, fstat() will return -EBADF:

3 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
4 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
5 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
9 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
...

This patch simply whitelists the EBADF errno code.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
Co-authored-by: Luís Henriques <lhenriques@suse.de>
2021-11-20 10:09:25 +00:00
Nikolaus Rath
d709c24cbd Released 3.10.5 2021-09-06 13:45:29 +01:00
lixiaokeng
aaf767a6cc
Fix: fd and memory leak in mount.fuse.c (#614)
The command isn't freed and the fuse_fd isn't
closed if execl failed. Fix it.

Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
2021-09-06 13:37:45 +01:00
a1346054
9677eca556 use same hashbang as in rest of repository 2021-08-25 14:46:25 +02:00
a1346054
173bffc9f4 fix spelling 2021-08-25 14:46:25 +02:00
a1346054
6100b64054 remove executable file mode bit from source files 2021-08-25 14:46:25 +02:00
Giulio Benetti
5f3fec6a79 meson.build: fix wrong .symver detection
As pointed here [1] __has_attribute() is broken for many attributes and
if it doesn't support the specific attribute it returns true, so we
can't really rely on that for this check. This lead to Buildroot
libfuse3 build failure [2] where that shows up with:
```
error: symver is only supported on ELF platforms
```
Indeed Microblaze doesn't support ELF since it doesn't include elfos.h,
but __has_attribute(symver) returns true.

So let's substitute the #ifdef __has_attribute() with a stronger test on
a function foo() with __attribute__((symver ("test@TEST"))).

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
[2]: http://autobuild.buildroot.net/results/d6c/d6cfaf2aafaeda3c12d127f6a2d2e175b25e654f/build-end.log

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
2021-08-04 09:56:44 +01:00
Nikolaus Rath
624327ba00 Travis-CI: Make sure lsan supppressions file can be read by root. 2021-06-24 09:11:29 +01:00
Amir Goldstein
570933394e Do not run unlinked files test on passthrough_hp with old kernels
test_syscalls unlinked testfiles check fails on passthourhg_hp without
the kernel commit "fuse: fix illegal access to inode with reused nodeid"
queued for kernel 5.14 [1].

Make this check opt-in and do not run it with kernel version before 5.14.

[1] https://lore.kernel.org/linux-fsdevel/CAJfpegtGKjeK8E5QsHKF0=re1J9wVHuGRVgg9NDJ_OOwQdCUNg@mail.gmail.com/

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-23 11:46:19 +01:00
lixiaokeng
a1e41676e3 Fix: a potential crash on failure to setlocale
setlocale() can fail, returning NULL, which will lead
to a crash in iconv_new(). Fix it like in iconv_help().

Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
2021-06-16 18:25:14 +01:00
Amir Goldstein
80f2b8b469 passthrough_hp: excercise reusing inode numbers
Before last unlink() release the reference on inode.fd to allow reuse
of underlying fs inode number, mark the server inode "deleted" and bump
it's generation counter.

When same inode number is found on lookup(), the server inode object will
be reused as well.

Skip this when inode has an open file and when writeback cache is enabled.

This will be used to verify inode reuse bug fix in the kernel.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Amir Goldstein
10ecd4fda4 test/test_syscalls.c: check unlinked testfiles at the end of the test
On some tests on regular files, open an O_PATH fd of the testfile and
record it along side the size and mode and inode.

At the end of all tests, use recorded testfiles info to re-check the size
mode and inode of the unlinked testfiles.

With O_PATH fd, the server does not have to keep the inode alive so FUSE
inode may be stale or bad.  Therefore, ESTALE and EIO are valid results
for fstat() on the old testfile fd's, but returning the wrong size or
mode is an invalid result.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Amir Goldstein
494e15127c test/test_syscalls.c: refactor fcheck_* helpers
Avoid multiple fstat() calls and consolidate all fcheck_* helpers
into fcheck_stat().

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Amir Goldstein
057d6de867 test/test_syscalls.c: use unique filename per test
Generate unique filename per test (only for regular file for now).
Make sure to unlink the unique filename after each test.

realpath variable was renamed to basepath_r to fix build warning
on conflicting symbols with realpath() function.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-14 09:13:12 +01:00
Nikolaus Rath
c56ba92047 Released 3.10.4 2021-06-09 09:13:01 +01:00
asafkahlon
c7a8b42f31
Add an option to disable building tests (#533)
Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
2021-06-09 09:07:25 +01:00
Christian Menges
57b46adc35
Cuse example: Fix memory leak (#607)
* cuse example: fix memory leak

* Travis CI: re-enable leak checking
2021-06-09 09:04:41 +01:00
Sergey Fedoseev
f4187fe5fa
fix typo in man (#609) 2021-06-09 09:04:08 +01:00
Amir Goldstein
8852a22399
test/test_syscalls.c: fix test failure on xfs src dir (#611)
rename dir loop test fails when test tmp dir is xfs with an error
 test_rename_dir_loop() - rename : File exists

That is because xfs returns EEXIST for the case of renaming over
a non-empty directory.

According to rename(2) man page, EEXIST and ENOTEMPTY are both valid
error code in this case.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2021-06-02 10:23:06 +01:00
Junichi Uekawa
0b6d97cf59
Define FUSE_USE_VERSION in Doxygen. (#608)
We currently do not pass anything in PREDEFINED and that means
FUSE_USE_VERSION is undefined.

Add that definition so that Doxygen built-in C pre-processor can use
FUSE_USE_VERSION value to find the correct comment to parse.
2021-05-19 09:32:14 +01:00
Christian Menges
7d1ba6b066
Fix memory leaks in examples (#604) 2021-05-09 11:12:01 +01:00
Christian Menges
995d46a205
Bump cxxopts from 2.2.0 to 2.2.1 (#602) 2021-05-09 10:00:57 +01:00
rfjakob
d169d512de
doc: Add "fuse (4)" to SEE ALSO sections in man pages (#601)
fuse (4) is an excellent introduction to the FUSE protocol,
and it lists fusermount (1) and mount.fuse (8) in its
SEE ALSO section.

I (the author of gocryptfs) was not aware of this man
page till March 2021, which suggest that it should be
made more discoverable.

So link back to fuse (4) in our SEE ALSO sections.
2021-05-08 14:15:55 +01:00
Junichi Uekawa
8c4d315108
Fix doxygen warnings. (#600)
Some parameters were undocumented, and @file does not mean to expand current file name.
2021-05-07 10:43:30 +01:00
Junichi Uekawa
98e261cfab
fusermount3.1: refer to mount.fuse3 (#599)
mount.fuse was renamed to mount.fuse3.
2021-05-05 10:51:08 +01:00
Manuel Jacob
d85d26b88c
Add missing exceptions to fuse_reply_err() documentation. (#597)
Co-authored-by: Manuel Jacob <test>
2021-04-23 08:31:37 +01:00
Heiko Becker
10bb961f63
Fix a few meson warnings (#596)
* Use meson's warning_level instead of passing -Wflags

"-Wall" is included by default and level 2 adds "-Wextra". Avoids a
warning from meson.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>

* Set the C++ language standard through a meson option

Avoids a warning from meson.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
2021-04-13 18:54:10 +01:00
Nikolaus Rath
f0c288fa09 Added ChangeLog template for next release. 2021-04-12 11:21:11 +01:00
Nikolaus Rath
f6cb8f23ac Released 3.10.3 2021-04-12 11:18:08 +01:00
Hookey
02eb082aea
Remove unused fuse_worker bufsize (#590)
Not used since 561d7054d8
2021-04-12 11:08:50 +01:00
Tobias Nießen
f4eaff6af0
Fix typo in fuse_lowlevel.h (#593) 2021-03-30 13:37:30 +01:00
Andrew Gaul
da474fe7d7
Fix typos (#592) 2021-03-25 08:40:27 +00:00
Jean-Pierre André
bdd2d4110f
Fix returning d_ino and d_type by readdir(3) in non-plus mode
When not using the readdir_plus mode, the d_type was not returned,
and the use_ino flag was not used for returning d_ino.

This patch fixes the returned values for d_ino and d_type by readdir(3)

The test for the returned value of d_ino has been adjusted to also
take the d_type into consideration and to check the returned values in
both basic readdir and readdir_plus modes. This is done by executing
the passthrough test twice.

Co-authored-by: Jean-Pierre André <jpandre@users.sourceforge.net>
2021-03-18 09:52:30 +00:00
Nikolaus Rath
77d662459a Released 3.10.2 2021-02-05 09:07:28 +00:00
Martin Pärtel
5012a05ac8
Fix returning inode numbers from readdir() in offset==0 mode. (#584)
- Test added for all passthrough examples.
- passthrough.c uses offset==0 mode. The others don't.
- passthrough.c changed to set FUSE_FILL_DIR_PLUS to make the test pass.
- This fixes #583.
2021-02-03 09:53:21 +00:00
Stephen Kitt
b9e3ea01db
Ignore "-o nonempty" (#582)
Commit 0bef21e854 removed "-o nonempty" since mounting over
non-empty directories is always allowed. But this broke tools which
specify "-o nonempty". Since the expected behaviour is the same
anyway, ignoring the "nonempty" option seems safe, and allows programs
specifying "-o nonempty" to continue working with fusermount3.

This would fix https://bugs.debian.org/939767

Signed-off-by: Stephen Kitt <steve@sk2.org>
2021-01-28 21:51:10 +00:00
Laurent Bigonville
d35470382b
Fix FTBFS on kfreebsd (#581)
kfreebsd is a FreeBSD kernel and a GNU libc

The only macro defined in that case is __FreeBSD_kernel__

Fix #580
2021-01-17 10:49:07 +00:00
John Baber-Lucero
e6df67cf1f
Fix a few typos in README.md. (#579)
* Fix a few typos in README.md.

* Change recommendation to mandate for meson and ninja

Co-authored-by: John Baber-Lucero <git@frundle.com>
2021-01-12 10:41:35 +00:00
Feverfew
770bccfcf2
Fix typo (#578) 2021-01-10 11:50:28 +00:00
richardweinberger
699ab32b5d
fusermount: Check for argv[0] being present (#577)
It is perfectly legal to execute a program with argc == 0 and therefore
no argv.
fusermount needs to check for this case, otherwise it will pass a NULL
poiunter to strdup() and cause undefined behavior.
Especially since fusermount is setuid root, we need to extra be careful.

Signed-off-by: Richard Weinberger <richard@nod.at>
2021-01-08 10:07:02 +00:00
Alan Somers
ccba27fbec
Fix FUSE_COPY_FILE_RANGE in the passthrough example (#575)
Only close the file descriptors if they were just opened.  Otherwise,
the second FUSE_COPY_FILE_RANGE operation on any given file will fail
with EBADF.
2021-01-01 19:34:58 +00:00
Sargun Dhillon
b96e475804
util/fusermount.c: Assume the kernel supports UMOUNT_NOFOLLOW (#574)
UMOUNT_NOFOLLOW was added in Kernel 2.6.34. It's been 10 years since it's been added
Kernel 5.9, and 5.10 break this check mechanism[1]. Let's deprecate it.

[1]: https://lore.kernel.org/linux-fsdevel/20201223102604.2078-1-sargun@sargun.me/

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
2020-12-27 11:17:46 +00:00
Kangjing "Chaser" Huang
9bfbeb576c
Add exfat to whitelist (#573) 2020-12-19 10:43:19 +00:00
Nikolaus Rath
cd4aae2de6 Released 3.10.1 2020-12-07 09:52:02 +00:00
Rethan
1acfb20cb3
examples/cuse_client: add include file to eliminate compiler warning (#568)
Compiler warning about close(fd), add include file to fix.

Signed-off-by: haoyixing <haoyixing@kuaishou.com>
Co-authored-by: haoyixing <haoyixing@kuaishou.com>
2020-11-24 09:28:13 +00:00
human
42f661ede1 fix errno comparison
this affected `-o remember` in single-thread mode, it could prematurely
exit if a signal was received

 # start an example filesystem from example/
 ./passthrough -f -s -o remember=5 ./mnt

 # make the poll() call return with EINTR
 pkill -PIPE passthrough
2020-11-17 11:06:32 +00:00
Zhiqiang Liu
f604536b08 buffer.c: correct return value when buf is NULL
In commit d614415a ("buffer.c: check whether buf is
NULL in fuse_bufvec_advance func"), if fuse_bufvec_current
func returns NULL, it returns 1 directly. Actually,
we should return 0 when buf is NULL.

Fixes: d614415a ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func")
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-11 09:32:56 +00:00