Commit Graph

571 Commits

Author SHA1 Message Date
Brendon Boldt
4e69c09f4b Add note about make clean for fuse build 2019-12-06 11:22:19 -05:00
Brendon Boldt
7beefecf44 Add Fedora, Ubuntu, Arch info to INSTALL
Add fuse3 (>=3.7) version to Makefile
2019-12-06 11:19:42 -05:00
Kent Overstreet
f712a866a4 Put valgrind support behind CONFIG_VALGRIND 2019-12-04 17:49:34 -05:00
Kent Overstreet
ffced87f08 Merge commit '780de81b36' 2019-11-28 15:08:27 -05:00
Justin Husted
780de81b36 Support remounting in fuse tests.
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-18 15:36:36 -08:00
Justin Husted
049dd7b79e Make valgrind optional in tests.
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>
2019-11-18 13:51:31 -08:00
Kent Overstreet
8c20176f2c Update bcachefs sources to d372ddcbfa bcachefs: Reorganize extents.c 2019-11-17 20:36:59 -05:00
Justin Husted
a00998c4cd Make fuse3 support optional and document.
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>
2019-11-11 12:18:22 -08:00
Kent Overstreet
1f7098c222 Update bcachefs sources to b1a4dc53be bcachefs: Set lost+found mode to 0700 2019-11-09 22:49:03 -05:00
Justin Husted
f597e81aab Temporary fix for lost+found file permission.
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>
2019-11-09 19:05:24 -08:00
Justin Husted
c3f09963af Implement basic fuse mount tests.
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>
2019-11-09 19:00:56 -08:00
Justin Husted
7bf4aa61a7 Fix memory leak in fuse write.
The write buffer was being leaked in bcachefs_fuse_write().

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-09 18:53:20 -08:00
Justin Husted
5337ad4a43 Make userspace blkdev cleanup code more robust.
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>
2019-11-07 18:58:32 -08:00
Justin Husted
76e147d0a9 Fix refcount bug in blkdev and timer kthreads.
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>
2019-11-07 16:44:04 -08:00
Justin Husted
ff695c5afb Use the correct clock for userspace time.
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>
2019-11-04 21:23:46 -08:00
Justin Husted
4ed889295c Add makefile support for tags.
Also, update .gitignore for various things.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-04 21:23:46 -08:00
Kent Overstreet
6016d33b80 Update bcachefs sources to 9e76e8d98c bcachefs: Fix uninitialized field in hash_check_init() 2019-11-04 12:53:59 -05:00
Justin Husted
61bc316a4d Initial version of bcachefs tests.
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>
2019-11-03 23:17:43 -05:00
Justin Husted
d79d57ef89 Stop blkdev completion thread at process exit time, to make valgrind
happy.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
97c6f60222 Stop workqueue threads at process exit time, to make valgrind happy.
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
b20e160735 Stop the timer task at process exit time, to make valgrind happy.
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
36e4b3147e Temporary import of valgrind fixes for bcachefs branch. 2019-11-03 23:17:43 -05:00
Justin Husted
37899250f3 Fix memory leak in cmd_format.c
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
bf7574260c Add better valgrind support for journal write buffers. 2019-11-03 23:17:43 -05:00
Justin Husted
ff4d082246 Change preempt_disable() etc. to use a recursive mutex.
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>
2019-11-03 23:17:43 -05:00
Justin Husted
2bc1166919 Add more fuse logging.
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Kent Overstreet
648b871d3d Enable caching of negative dentries 2019-10-18 16:51:15 -04:00
Kent Overstreet
b5af93e90f Simplify readdir 2019-10-18 16:24:18 -04:00
Kent Overstreet
8e6afb875d Write path now updates i_size/i_sectors 2019-10-18 16:23:39 -04:00
Justin Husted
3214b44d90 Use proper flags mask. 2019-10-18 16:23:39 -04:00
Justin Husted
fd0b8fe7f0 Prettify the align_io function by returning by value. 2019-10-18 16:23:39 -04:00
Justin Husted
de151b0659 Fix missing mode setting in fuse mkdir. 2019-10-18 16:23:39 -04:00
Justin Husted
0df96db46e Add fuse symlink and readlink support.
Also fix link.
2019-10-18 16:23:39 -04:00
Justin Husted
426d2c74fd Implement unaligned write support for fuse. Seems to work on initial
testing, but there are problems with cache coherency and journaling.
2019-10-18 16:23:39 -04:00
Justin Husted
1a8288cba2 Factor alignment logic out of bcachefs_fuse_read. 2019-10-18 16:23:39 -04:00
Justin Husted
0521494e79 Implement unaligned read support for fuse. 2019-10-18 16:23:39 -04:00
Justin Husted
f8076573b5 Make fuse read and write work (for aligned writes).
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.
2019-10-18 16:23:39 -04:00
Justin Husted
52771aa7d2 Fix fuse read/write to not segfault on unaligned IO. 2019-10-18 16:23:39 -04:00
Kent Overstreet
415a3651fc initialize op->pos for write 2019-10-18 16:23:39 -04:00
Justin Husted
e1ed5557bf Add valgrind handling: data read from io_submit was not being marked
properly. Manually mark it.

This might be better done by improving the valgrind wrapper for
io_submit.
2019-10-18 16:23:39 -04:00
Kent Overstreet
94980e1892 fill in .st_ino in .getattr 2019-10-18 16:23:39 -04:00
Kent Overstreet
81551c8f1b build fixes; initial read/write methods 2019-10-18 16:23:39 -04:00
Justin Husted
8b6497b4e7 Fix infinite looping behavior with readdir.
Also adds partial . and .. support, and implements ENOTDIR error.

The source of this problem was due to the off-by-one interface expected
by readdir. Each directory entry contains a pointer to next, so it
cannot be emitted to the user until the next entry is actually read.

Returning the current position + 1 is insufficient, because the user
will just retry cur + 1 as the start position to see if they've reached
the end of the directory.

Since directory entries are keyed by a 64-bit hash in bcachefs, the
result was that the user would call readdir over and over with what it
believed the next pointer to be until "cur + 1" reached some enormous
64-bit value related to the hash for the "lost+found" entry.
2019-10-18 16:23:39 -04:00
Justin Husted
08ce726f9c Implement option parsing for fuse. The syntax is:
bcachefs fusemount dev mountpoint
or
bcachefs fusemount dev1:dev2:... mountpoint
2019-10-18 16:23:39 -04:00
Kent Overstreet
bc45c28470 fuse 2019-10-18 16:23:39 -04:00
Kent Overstreet
3c810611c1 Update bcachefs sources to fc4f1d59cf bcachefs: Fix an iterator counting bug 2019-10-16 14:13:07 -04:00
Kent Overstreet
6e696ea087 Update bcachefs sources to de906c3e2e bcachefs: Fix iterator counting for reflink pointers (again) 2019-10-12 14:49:11 -04:00
Kent Overstreet
cec69929f0 Update bcachefs sources to d0625a4418 bcachefs: Fix creation of lost+found 2019-10-11 15:04:27 -04:00
Kent Overstreet
7f3557f57e Update bcachefs sources to 7e03c1ab0e bcachefs: Kill bchfs_extent_update() 2019-10-10 18:06:44 -04:00
Kent Overstreet
62f5e4fa67 Update bcachefs sources to ce9293e9d0 bcachefs: Factor out fs-common.c 2019-10-04 16:26:48 -04:00