aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
2019-09-10log: move fuse_log() to the public header fileStefan Hajnoczi-3/+14
Applications may wish to call fuse_log() for unified logging. This way they don't need to define their own wrappers to invoke the log message handler function installed by fuse_set_log_func(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-09-09passthrough_ll: fix fallocate variant ifdefs (#449)Dr. David Alan Gilbert-2/+2
If fallocate isn't available we incorrectly check for the value of HAVE_POSIX_FALLOCATE rather than it being defined. We also fail to initialise 'err' in the case where neither are defined. Fixes: 5fc562c90d7925963467 ("Add fallocate and use it instead of ...") Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2019-09-04Introduce callback for loggingStefan Hajnoczi-175/+303
Introduce an API for custom log handler functions. This allows libfuse applications to send messages to syslog(3) or other logging systems. See include/fuse_log.h for details. Convert libfuse from fprintf(stderr, ...) to log_fuse(level, ...). Most messages are error messages with FUSE_LOG_ERR log level. There are also some debug messages which now use the FUSE_LOG_DEBUG log level. Note that lib/mount_util.c is used by both libfuse and fusermount3. Since fusermount3 does not link against libfuse, we cannot call fuse_log() from lib/mount_util.c. This file will continue to use fprintf(stderr, ...) until someone figures out how to split it up. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-29Avoid gcc 9.1 strncpy(3) warnings (#447)Stefan Hajnoczi-4/+5
Recent GCC releases have warnings related to common strncpy(3) bugs. These warnings can be avoided by explicitly NUL-terminating the buffer or using memcpy(3) when the intention is to copy just the characters without the NUL terminator. This commit fixes the following warnings: [1/27] Compiling C object 'test/9f86d08@@test_syscalls@exe/test_syscalls.c.o'. In function ‘test_socket’, inlined from ‘main’ at ../test/test_syscalls.c:1899:9: ../test/test_syscalls.c:1760:2: warning: ‘strncpy’ output may be truncated copying 108 bytes from a string of length 1023 [-Wstringop-truncation] 1760 | strncpy(su.sun_path, testsock, sizeof(su.sun_path)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [2/27] Compiling C object 'lib/76b5a35@@fuse3@sha/fuse.c.o'. ../lib/fuse.c: In function ‘add_name’: ../lib/fuse.c:968:2: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 968 | strncpy(s, name, len); | ^~~~~~~~~~~~~~~~~~~~~ ../lib/fuse.c:944:15: note: length computed here 944 | size_t len = strlen(name); | ^~~~~~~~~~~~ [3/27] Compiling C object 'lib/76b5a35@@fuse3@sha/fuse_lowlevel.c.o'. ../lib/fuse_lowlevel.c: In function ‘fuse_add_direntry’: ../lib/fuse_lowlevel.c:288:2: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 288 | strncpy(dirent->name, name, namelen); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/fuse_lowlevel.c:276:12: note: length computed here 276 | namelen = strlen(name); | ^~~~~~~~~~~~ ../lib/fuse_lowlevel.c: In function ‘fuse_add_direntry_plus’: ../lib/fuse_lowlevel.c:381:2: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 381 | strncpy(dirent->name, name, namelen); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/fuse_lowlevel.c:366:12: note: length computed here 366 | namelen = strlen(name); | ^~~~~~~~~~~~ Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-23Shorten comment.Nikolaus Rath-5/+0
2019-08-23Improve description of READDIRPLUS_AUTO.Nikolaus Rath-0/+9
2019-08-23Clarify bitfield padding issue (#445)AsumFace-2/+8
* Clarify bitfield padding issue * Add a more elaborate note to fuse_file_info
2019-07-23fuse-lowlevel: set pipe size to max (#438)Giuseppe Scrivano-0/+35
on failure to set the pipe size, set it to the maximum allowed by the kernel. If the first request required more than the maximum allowed, the can_grow flag would be reset thus preventing any further resize. Grow the pipe to the maximum allowed to increase the likelihood of using splice for successive requests instead of falling back to read/write. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-09Sync fuse_kernel.h with Linux 5.2 (#433)Kirill Smelkov-1/+24
2019-07-09Released 3.6.2Nikolaus Rath-3/+3
2019-07-09Do not run passthrough test when caching is active.Nikolaus Rath-1/+2
Readdir caching means that direct modifications to the source directory will not be seen immediately, so the test becomes flaky. Fixes: #416.
2019-07-09Install init script in /etc/ instead of $sysconfdirNikolaus Rath-2/+8
sysconfdir defaults to /usr/local/etc which is almost always the wrong choice. Fixes: #427
2019-07-05test_cuse: fix runtime errorNikolaus Rath-4/+4
We are no longer using the capfd mechanism.
2019-07-04Fix output checking in test casesNikolaus Rath-95/+114
py.test's capture plugin does not work reliably when used by other fixtures. Therefore, implement our own version.
2019-07-04Add build option to skip steps requiring root permissionsDrDaveD-9/+16
2019-06-15Fix build with IGNORE_MTAB (#425)Michael Forney-0/+2
chdir_to_parent and check_is_mount are used by should_auto_mount, added in fuse-3.3.0, regardless of whether IGNORE_MTAB is defined.
2019-06-13Released 3.6.1Nikolaus Rath-1/+7
2019-06-13Released 3.6.0Nikolaus Rath-3/+8
2019-06-13fuse_lowlevel: Add max_pages support (#384)scosu-9/+33
Starting with kernel version 4.20 fuse supports a new property 'max_pages' which is the maximum number of pages that can be used per request. This can be set via an argument during initialization. This new property allows writes to be larger than 128k. This patch sets the property if the matching capability is set (FUSE_MAX_PAGES). It will also set max_write to 1MiB. Filesystems have the possibility to decrease this size by setting max_write to a smaller size. The max_pages and bufsize fields are adjusted accordingly. Cc: Constantine Shulyupin <const@MakeLinux.com> Signed-off-by: Markus Pargmann <scosu@quobyte.com>
2019-06-06Avoid pointer arithmetic with `void *`Michael Forney-8/+8
The pointer operand to the binary `+` operator must be to a complete object type. Since we are working with byte sizes, use `char *` instead.
2019-06-06Don't return expression in function returning voidMichael Forney-1/+1
This is a constraint violation in ISO C[0]. [0] http://port70.net/~nsz/c/c11/n1570.html#6.8.6.4p1
2019-06-06Don't omit second operand to `?` operatorMichael Forney-1/+1
This is a GNU C extension.
2019-05-24Remove incorrect comment about fuse_entry_param.generation (#420)Alan Somers-3/+0
A comment said that fuse_entry_param.generation must be non-zero. However, I can't find anything in the kernel that requires that, and real-world file systems don't seem to follow that advice, either.
2019-05-15passthrough: fix unix-domain sockets on FreeBSD (#413)Alan Somers-27/+163
FreeBSD doesn't allow creating sockets using mknod(2). Instead, one has to use socket(2) and bind(2). Add appropriate logic to the examples and add a test case.
2019-05-12Fix includes of non-system headers.Nikolaus Rath-2/+2
Fixes: #415.
2019-05-09Added new example filesystemNikolaus Rath-7/+3467
passthrough_hp puts emphasis and performance and correctness, rather than simplicity.
2019-05-05add defines for missing SECBITs on older kernels (#409)DrDaveD-0/+19
2019-05-05Fixed type of ioctl command parameter.Nikolaus Rath-3/+3
2019-05-05Fixed permissions.Nikolaus Rath-0/+0
2019-05-01Fixed Cirrus Config (#405)Fedor Korotkov-2/+4
2019-05-01Add CI for FreeBSD (#404)Alan Somers-1/+12
Fixes #403
2019-04-30Added issue template.Nikolaus Rath-2/+16
2019-04-30Added information about development status.Nikolaus Rath-0/+14
2019-04-18Add fallocate and use it instead of posix_fallocate if possible (#398)Liu Bo-1/+8
fuse.ko has supported FALLOC_FL_KEEP_SIZE and FALLOC_FL_PUNCH_HOLE at this moment and more modes may be supported in the future. fallocate(2) supports modes while posix_fallocate(2) does not, so this makes lo_fallocate use fallocate(2) instead. Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
2019-04-16Released 3.5.0Nikolaus Rath-2/+5
2019-04-16Add documentation for opting out of opendir and releasedir (#391)Chad Austin-0/+24
2019-04-07Bump minor versionNikolaus Rath-3/+3
cache_readdir flag is a new feature.
2019-04-06Add support for in-kernel readdir caching.Nikolaus Rath-5/+20
Fixes: #394.
2019-04-06Synchronize fuse_kernel.h with current kernel master.Nikolaus Rath-2/+18
2019-04-06Delete FUSE_FSYNC_FDATASYNCNikolaus Rath-9/+2
This constant is not defined in the kernel, so it will be lost when fuse_kernel.h is not synchronized. Instead, the kernel just passes a flag value of "1", so for now we also use a literal in userspace.
2019-04-06Various documentation improvementsAlan Somers-18/+28
See issue #389 for some related discussions.
2019-04-03Whitelist smb2 (#392)Peter Lemenkov-4/+7
See also https://bugzilla.redhat.com/1694552#c7 Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2019-03-11Defined the (*ioctl)() commands as unsigned int (#381)Jean-Pierre André-12/+24
Instead of the Posix ioctl(2) command, Linux uses its own variant of ioctl() in which the commands are requested as "unsigned long" and truncated to 32 bits by the fuse kernel module. Transmitting the commands to user space file systems as "unsigned int" is a workaround for processing ioctl() commands which do not fit into a signed int.
2019-03-11Define ALLPERMS for musl libc systems. (#379)maxice8-0/+4
2019-03-10Improve documentation for the flush method (#378)Alan Somers-15/+26
Fixes: #373
2019-03-09Released 3.4.2Nikolaus Rath-4/+13
2019-03-09Improve readdir() and file handle documentationChad Austin-11/+22
Fixes: #333
2019-03-09Add HFS+ to filesystem whitelist (#347)1c7718e7-0/+3
2019-03-09Work around -Wformat-truncation=/-Wformat-overflow= warnings (#356)Tomohiro Kusumi-5/+5
sprintf(3)/snprintf(3) destination buffers need to be large enough so that gcc doesn't warn -Wformat-truncation= or -Wformat-overflow= when source buffer size is 1024 bytes. -- ../test/test_syscalls.c:1445:47: warning: '%s' directive output may be truncated writing 1 byte into a region of size between 0 and 1023 [-Wformat-truncation=] #define PATH(p) (snprintf(path, sizeof path, "%s/%s", testdir, p), path) ^~~~~~~ ../test/test_syscalls.c:1458:19: res = mkdir(PATH("a"), 0755); ~~~ Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
2019-03-09Correctly include config.h ("" vs <>)Nikolaus Rath-3/+3
This isn't a system header. Fixes: #349