aboutsummaryrefslogtreecommitdiff
path: root/test/test_syscalls.c
Commit message (Collapse)AuthorAge
* Fix readdir() bug when a non-zero offset is specified in filler (#269)Gravatar Rostislav2018-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug occurs when a filesystem client reads a directory until the end, seeks using seekdir() to some valid non-zero position and calls readdir(). A valid 'struct dirent *' is expected, but NULL is returned instead. Pseudocode demonstrating the bug: DIR *dp = opendir("some_dir"); struct dirent *de = readdir(dp); /* Get offset of the second entry */ long offset = telldir(dp); /* Read directory until the end */ while (de) de = readdir(de); seekdir(dp, offset); de = readdir(dp); /* de must contain the second entry, but NULL is returned instead */ The reason of the bug is that when the end of directory is reached, the kernel calls FUSE_READDIR op with an offset at the end of directory, so the filesystem's .readdir callback never calls the filler function, and we end up with dh->filled set to 1. After seekdir(), FUSE_READDIR is called again with a new offset, but this time the filesystem's .readdir callback is never called, and an empty reply is returned. Fix by setting dh->filled to 1 only when zero offsets are given to filler function.
* rename: perform user mode dir loop check when not done in kernelGravatar Bill Zissimooulos2018-05-18
| | | | | | | | | | | | Linux performs the dir loop check (rename(a, a/b/c) or rename(a/b/c, a), etc.) in kernel. Unfortunately other systems do not perform this check (e.g. FreeBSD). This results in a deadlock in get_path2, because libfuse did not expect to handle such cases. We add a check_dir_loop function that performs the dir loop check in user mode and enable it on systems that need it.
* Skip tests that aren't supported under FreeBSD.Gravatar Nikolaus Rath2017-08-11
|
* Don't check st_nlink value for mkdirGravatar Nikolaus Rath2017-08-03
| | | | | | Some filesystems don't track this for directories. Fixes: #180.
* Added experimental support for building with Meson+NinjaGravatar Nikolaus Rath2017-01-12