Commit Graph

697 Commits

Author SHA1 Message Date
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
Kent Overstreet
b540b170c9 Update bcachefs sources to cddca21efc bcachefs: Don't use sha256 for siphash str hash key 2019-10-04 16:22:37 -04:00
Kent Overstreet
7f69c4161c Update bcachefs sources to 380885b0b8 bcachefs: Fix counting iterators for reflink pointers 2019-10-01 16:30:36 -04:00
Kent Overstreet
98b8f8d0c0 Update six locks 2019-10-01 15:55:42 -04:00
Kent Overstreet
db39aa3e1b Update bcachefs sources to 5a3a4087af bcachefs: Convert a BUG_ON() to a warning 2019-09-25 15:23:50 -04:00
Kent Overstreet
ceee9244de Have cmd_dump fix errors
Some errors can't be ignored, and fsck and thus dump will only complete
if we're fixing errors.
2019-08-29 13:33:42 -04:00
Kent Overstreet
aa2a42b0a6 Update bcachefs sources to fee79cd654 bcachefs: Fix BTREE_INSERT_NOMARK_OVERWRITES 2019-08-29 13:32:04 -04:00
Kent Overstreet
68963f1816 Update bcachefs sources to 0d627739e9 bcachefs: Improve pointer marking checks and error messages 2019-08-29 11:44:11 -04:00
Kent Overstreet
7f35a52029 Add a way to pass arbitrary mount options to fsck 2019-08-28 13:43:45 -04:00
Kent Overstreet
92fc14824f Update bcachefs sources to 05ef7000f2 bcachefs: Switch reconstruct_alloc to a mount option 2019-08-28 13:43:42 -04:00
Kent Overstreet
8192cc8ed8 Update llist code
This fixes a bug where the compiler was dropping a null ptr check
2019-08-28 11:35:00 -04:00
Kent Overstreet
e6e7d374e7 Update bcachefs sources to bfb7133d71 bcachefs: Refactor bch2_alloc_write() 2019-08-28 11:09:35 -04:00
Kent Overstreet
c8322ce68c Update bcachefs sources to 4ed63a3241 bcachefs: Trust in memory bucket mark 2019-08-28 00:31:57 -04:00
Kent Overstreet
cc41f52bcc Update bcachefs sources to 14f68409be bcachefs: Optimize fiemap 2019-08-27 17:37:03 -04:00
Kent Overstreet
8b02f791c3 Build with -fno-delete-null-pointer-checks
Some of the code we use from the Linux kernel won't build correctly
without this...
2019-08-27 13:33:57 -04:00
Kent Overstreet
72a408f848 Update bcachefs sources to ece184f718 bcachefs: Reflink 2019-08-21 13:19:36 -04:00
koverstreet
f5ec33b556
Merge pull request #20 from highvoltage/master
Fix typos
2019-08-21 12:20:30 -04:00
Jonathan Carter
ed1c0e8c30 Fix typos 2019-08-21 10:19:25 +02:00
koverstreet
4c96e9dda3
Merge pull request #19 from stintel/master
cmd_device_remove: allow removal by device id
2019-08-17 14:24:56 -04:00
Stijn Tintel
e57c053797 cmd_device_remove: allow removal by device id
If a disk is absent, there is no way to remove it from the filesystem.
Add the possibility to remove devices by id, to allow removal of missing
disks.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2019-08-16 21:07:32 +03:00
Kent Overstreet
692eadd6ca Update bcachefs sources to 22776fe990 bcachefs: Convert some assertions to fsck errors 2019-07-13 13:10:00 -04:00
Kent Overstreet
08021fd550 Update bcachefs sources to b5fff15213 bcachefs: Fix ec_stripes_read() 2019-07-12 17:11:10 -04:00
Kent Overstreet
33c91e2ff4 Update bcachefs sources to 44dc1f2695 bcachefs: Fix stripe_idx_to_delete() 2019-07-11 12:46:42 -04:00
Kent Overstreet
f96ba8e0aa Update bcachefs sources to b91a514413 bcachefs: Don't try to delete stripes when RO 2019-07-11 12:00:51 -04:00
Kent Overstreet
07a0a5b5c4 Fix cmd_fs_usage for more than 4 devices
The ioctl returns -ERANGE when there's more devices than fit in the
buffer, not -ENOSPC

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-06-13 11:10:49 -04:00