Commit Graph

1446 Commits

Author SHA1 Message Date
Kent Overstreet
2007d9b6ce Fix bch2_super_write() alignment
We're about to switch to O_DIRECT only, which means we need to write
with proper alignment.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-10 22:27:22 -05:00
Thomas Bertschinger
9a9af6e9e6 create common entry point for Rust commands
The bcachefs sub-commands that are implemented in Rust (completions,
list, and mount) had separate entrypoints and thus had some differences
in behavior.

This introduces a common entry point for the Rust sub-commands. This
reduces duplicate boilerplate code like parsing argv and setting up
logging, and will facilitate converting more sub-commands to Rust in
the future.

An immediate benefit is that this fixes an issue with `bcachefs list`
not reporting errors:

before:

$ bcachefs list /dev/typo
$ echo $?
0

after:

$ bcachefs list /dev/typo
ERROR - bcachefs_rust::cmd_list: Fatal error: "No such file or directory"
$ echo $?
1

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-07 21:38:31 -05:00
Kent Overstreet
b90031efaa Update bcachefs sources to cbb2e45634dd bcachefs: fix simulateously upgrading & downgrading
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05 20:00:08 -05:00
Kent Overstreet
ba4c17c12b atomic64_read_acquire() should be inline
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05 15:11:51 -05:00
Kent Overstreet
e7049c592a cmd_show_super: --field-only 2024-01-05 13:01:34 -05:00
Kent Overstreet
799439a88a Update bcachefs sources to d267e10a43b2 bcachefs: __bch2_sb_field_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05 13:01:34 -05:00
Kent Overstreet
605e2311d9 linux header updates
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05 13:01:34 -05:00
Kent Overstreet
30c4b24b77 fix show_super default fields
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05 12:07:57 -05:00
Kent Overstreet
a751fe3a3c cmd_reset_counters
Add a subcommand for resetting superblock counters - for automated tests

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-04 19:56:14 -05:00
Kent Overstreet
e51f25af3c fix list_journal for nochanges
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-03 23:14:56 -05:00
Kent Overstreet
1f79cf3825 Update bcachefs sources to 2a6125decb43 bcachefs: bch_sb_field_downgrade
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-03 20:31:37 -05:00
Kent Overstreet
3054e5debb improve do_splice() 2024-01-03 20:30:44 -05:00
Kent Overstreet
378ae738d5 Update bcachefs sources to 5264e9f4d0c0 bcachefs: fix setting version_upgrade_complete 2023-12-30 16:04:21 -05:00
Kent Overstreet
44bf7868e5 fix missing atomic64_read_acquire on 32 bit
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-29 20:16:47 -05:00
Kent Overstreet
9a1e627a5d fix cmd_list for new nochanges semantics
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-27 21:50:46 -05:00
koverstreet
3070f45d96
Merge pull request #196 from Conan-Kudo/spec-libexecdir
packaging: Update RPM spec to use %_libexecdir for libexec files
2023-12-24 09:11:48 -05:00
Neal Gompa
a0398cf66f packaging: Update RPM spec to use %_libexecdir for libexec files 2023-12-24 09:09:56 -05:00
Kent Overstreet
d101ad4a61 Update bcachefs sources to 44ac32df8e0c bcachefs: Split brain detection 2023-12-24 08:48:31 -05:00
koverstreet
d01f3f590c
Merge pull request #195 from Conan-Kudo/use-libexec
Makefile, fsck: Use libexec instead of lib
2023-12-24 08:47:55 -05:00
Neal Gompa
89abdd8727 Makefile, fsck: Use libexec instead of lib
These are executables that need to be installed in a non-path location.
Most distributions now install these into /usr/libexec, and the
path variable for this is LIBEXECDIR, so use that instead.
2023-12-24 08:34:16 -05:00
Kent Overstreet
8e56da27fd fixup for old gcc
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-23 19:47:08 -05:00
Kent Overstreet
bc1680d488 v1.4.0: Split brain detection
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-23 19:39:01 -05:00
Kent Overstreet
4524069e52 cmd_fsck: -k, run fsck in kernel
This adds a new option to cmd_fsck for using the kernel implementation
of fsck instead of userspace, via the BCH_IOCTL_FSCK_OFFLINE ioctl.

This isn't intended for normal usage - mainly for testing and debugging
purposes, and for when the kernel version of bcachefs better matches the
on disk format version.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-23 19:39:01 -05:00
Kent Overstreet
f0334bbc10 Update bcachefs sources to 72740a707b64 bcachefs: Split brain detection
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-23 17:10:03 -05:00
Kent Overstreet
ca4892af17 cmd_fsck can now take colon separated devices
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-22 23:30:55 -05:00
Kent Overstreet
5134a64ceb Update bcachefs sources to c6d45169c6 bcachefs: Convert split_devs() to darray 2023-12-22 21:21:14 -05:00
koverstreet
e962ffb769
Merge pull request #194 from intelfx/work/makefile-nonrecursive
Makefile: do not recursively expand flags (speed up parallel builds considerably)
2023-12-22 04:49:58 -05:00
Ivan Shapovalov
ae818d9579 Makefile: avoid recursively expanding expensive variables
Specifically, do not recursively expand $(CFLAGS) because this leads to
repeatedly performing compile tests (e. g. cc-disable-warning) on every
recipe execution.

Without (nproc=32):
```
$ time env -i PATH=/usr/bin BCACHEFS_FUSE=1 NO_RUST=1 make -j$(nproc)
<...>
    [LD]     bcachefs
  72,48s user 11,29s system 190% cpu 44,036 total
```

With:
```
$ time env -i PATH=/usr/bin BCACHEFS_FUSE=1 NO_RUST=1 make -j$(nproc)
<...>
    [LD]     bcachefs
  66,79s user 5,17s system 1955% cpu 3,679 total
```
2023-12-22 11:41:54 +03:00
Kent Overstreet
eaca023d53 Silence a few rust build warnings
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-21 19:49:55 -05:00
Kent Overstreet
596ec1050d Update bcachefs sources to df6415fefb27 bcachefs: Fixes for rust bindgen 2023-12-21 19:49:00 -05:00
Kent Overstreet
93241a1c9a Update bcachefs sources to 5d0a6c2b32f1 bcachefs: check_directory_structure() can now be run online 2023-12-21 19:10:40 -05:00
Thomas Bertschinger
2b97686ffa remove Rust artifacts during make clean
This should use `cargo clean` instead of `rm -rf ...`. Also,
due to a typo, the `rm` did not actually remove the Rust artifacts.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-20 18:45:43 -05:00
Kent Overstreet
0bacefdf5f cmd_list_journal: fix check to print entry header
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 21:28:43 -05:00
Kent Overstreet
4158833a51 cmd_migrate: don't link data above i_size
The new filesystem might have a smaller blocksize than the old
blocksize, which trips this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 20:35:24 -05:00
Thomas Bertschinger
f06fd08067 docs: add llvm-config dependency for arch, fedora
This adds on to 446ec6b092 ("docs: mention that libclang is
required"). That commit updated the dependency list for Debian. This
adds the packages needed to get llvm-config for arch and fedora.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 19:52:37 -05:00
Kent Overstreet
411eb2575e cmd_migrate: fix memory leaks
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 19:43:30 -05:00
Kent Overstreet
2b28e8f7d2 make allocator helpers inlines
this gets us better log messages when using -fsanitize=address

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 19:30:15 -05:00
Kent Overstreet
5fa4e3da62 cmd_migrate: check for write errors
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 19:30:00 -05:00
Kent Overstreet
fe37b584d3 fix shrinker_free()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 19:29:25 -05:00
Kent Overstreet
3233d8a0c4 cmd_migrate: fix write_data()
passing a parent closure is totally unnecessary when using
BCH_WRITE_SYNC - and pops an assert in debug mode, because the write
path no longer supports delivering completions that way.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19 19:17:21 -05:00
Kent Overstreet
f2cb831b99 v1.3.6
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-18 23:29:06 -05:00
Kent Overstreet
e9df26f9c9 Drop mlockall()
now that we have
 - shrinkers running in the background via a thread
 - run_shrinkers() considering swap usage

this can probably be safely dropped - and it causes problems when
running as non root, so let's do so.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-18 23:21:43 -05:00
Kent Overstreet
f76d246fff Update bcachefs sources to 1a739db0b256 bcachefs; guard against overflow in btree node split
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-18 23:21:21 -05:00
Kent Overstreet
b7453196fe cmd_dump: fix error message
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-17 15:42:51 -05:00
Kent Overstreet
d8e7f3671d Fix makefile when building without systemd
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-16 18:42:22 -05:00
Kent Overstreet
b6740e5392 Update bcachefs sources to 841a95c29f4c bcachefs: fix userspace build errors
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-15 22:20:39 -05:00
Alexander Fougner
4c5dcb018d fix packaging
- make deb fails with dh: error: Unknown sequence --with
  (options should not come before the sequence)

- fix deb build deps

- add missing rpm files

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-10 12:16:00 -05:00
Chris Webb
b44629a3db bcachefs-tools: Fix typo in 872cd43
6% of physical RAM is info.totalram >> 4 not info.totalram << 4.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-10 12:14:23 -05:00
Chris Webb
cc98a16776 bcachefs-tools: Disable -Wgnu-variable-sized-type-not-at-end for clang
clang's default warnings include -Wgnu-variable-sized-type-not-at-end,
producing a lot of false alarms about the GNU extension for libbcachefs.
Disable these using cc-disable-warning when building with clang.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-09 23:29:04 -05:00
Chris Webb
0d401928b8 bcachefs-tools: Guard the __struct_group() #define in kernel.h
Our include/linux/byteorder.h uses the system <asm/byteorder.h>
because we don't provide our own in include/asm. This then pulls in
system <linux/stddef.h> which defines __struct_group. That definition
collides with the unconditional #define __struct_group in our local
include/linux/kernel.h, provoking preprocessor warnings.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-09 23:28:58 -05:00