Since valgrind runtime support is disabled by default, we shouldn't run
the tests with valgrind by default.
Signed-off-by: Justin Husted <sigstop@gmail.com>
Add an option to disable valgrind in the test suite, via the variable:
BCACHEFS_TEST_USE_VALGRIND=no
Additionally, note how to run tests in parallel in the INSTALL documentation.
Signed-off-by: Justin Husted <sigstop@gmail.com>
The experimental fuse3 support is not complete yet, and fuse3 is new and
still difficult to install on some platforms.
Make it optional at compile time, and default to off.
Signed-off-by: Justin Husted <sigstop@gmail.com>
lost+found should not be group or world readable. This is a staging fix
pending merge with the kernel tree.
Signed-off-by: Justin Husted <sigstop@gmail.com>
The purpose of these tests is to verify that bcachefs fuse support works
as expected, including gathering valgrind errors from the bcachefs
executable.
To do this, bcachefs is executed from a helper thread in the new
util.BFuse class, which goes about setting up and validating the
valgrind data as well as making sure the mount has completed
sufficiently before the test starts executing.
This also includes some basic functionality smoke tests which cover file
creation, timestamps, etc.
Signed-off-by: Justin Husted <sigstop@gmail.com>
The existing cleanup code would silently cancel disk IO requests, if
somehow the calling code did not wait for completion. This code now
tracks requests and will bug if any are lost.
Signed-off-by: Justin Husted <sigstop@gmail.com>
The shutdown code in d79d57e and b20e160 had a race condition during
shutdown, due to not owning a reference on the associated task_struct
while the associated threads shut themselves down.
Patch over this by taking an appropriate reference.
Signed-off-by: Justin Husted <sigstop@gmail.com>
The ktime_get_coarse_real_ts64() implementation for userspace was using
CLOCK_MONOTONIC instead of CLOCK_REALTIME_COARSE. This resulted in
files being timestamped with a time close to the unix epoch.
Signed-off-by: Justin Husted <sigstop@gmail.com>
So far, these tests just test basic format, fsck, and list functions
under valgrind, as well as a few self-validation tests.
Signed-off-by: Justin Husted <sigstop@gmail.com>
This is part of the userspace implementation of the kernel APIs for
bcachefs-tools. The previous implementation just provided a barrier, but
this isn't sufficient to make the associated percpu implementation safe.
Signed-off-by: Justin Husted <sigstop@gmail.com>
Read: There was a missing refcount on the closure.
Write: Unlike in the Linux kernel, we need to manually update the size
and timestamps, otherwise the operation will appear complete when viewed
via the cached inode, but after unmounting and mounting again the write
will be undone.