Commit Graph

1175 Commits

Author SHA1 Message Date
Kent Overstreet
f27b135285 Update bcachefs sources to 71a5b27e017d bcachefs: Make backpointer fsck wb flush check more rigorous
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-30 02:20:51 -05:00
Kent Overstreet
3bd4653767 Update bcachefs sources to 676dd269f0f8 mean and variance: Promote to lib/math 2023-11-29 22:42:52 -05:00
Kent Overstreet
46d5160869 Update bcachefs sources to eb83f1f842bb mean and variance: Promote to lib/math 2023-11-29 22:00:41 -05:00
Kent Overstreet
314ce7d963 add a fallback __DECLARE_FLEX_ARRAY
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-29 17:41:06 -05:00
Kent Overstreet
89b361f24a Update bcachefs sources to c3e4d892b77b mean and variance: Promote to lib/math 2023-11-29 17:00:30 -05:00
Brett Holman
1dc5842111 man: Fix cmd-option format
Options prgquote and degraded only had a single leading hyphen.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-27 21:04:03 -05:00
Brian Foster
1cdb7812d1 bcachefs-tools: don't skip stale superblock wipe in force mode
Even though the blkid wipe has been fixed to detect and wipe old
superblocks, we still incorrectly skip the wipe when in force mode.
Update the force logic in open_for_format() to bypass the user
request and otherwise proceed with the wipe.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-27 21:04:03 -05:00
Kent Overstreet
843707ede6 cmd_list_journal: Apply star_start_of_lines() correctly
In list_journal, we note which journal entries are being ignored - this
was forgetting to mark entries newer than the newest flush.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-27 21:04:03 -05:00
Kent Overstreet
97c86db4f2 Update bcachefs sources to feaca6edbd24 mean and variance: Promote to lib/math
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-27 21:04:03 -05:00
Kent Overstreet
7465d1934c Convert to BCH_IOCTL_DEV_USAGE_V2
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-27 21:04:03 -05:00
Kent Overstreet
3a0cc86e76 Update bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entry_data_usage 2023-11-25 21:51:30 -05:00
Kent Overstreet
138397d892 cmd_fs_usage: Print out replica set durability
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-25 00:06:32 -05:00
Alexander Batischev
446ec6b092 docs: mention that libclang is required
This fixes the following build failure on Debian bookworm:

    error: failed to run custom build command for `clang-sys v1.6.1`

    Caused by:
      process didn't exit successfully: `/home/minoru/src/bcachefs-tools/rust-src/target/release/build/clang-sys-df95f6d1266be773/build-script-build` (exit status: 101)
      --- stdout
      cargo:warning=could not execute `llvm-config` one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid `llvm-config` executable it will be used to try to find an instance of `libclang` on your system: "couldn't execute `llvm-config --prefix` (path=llvm-config) (error: No such file or directory (os error 2))"

      --- stderr
      thread 'main' panicked at /home/minoru/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clang-sys-1.6.1/build/dynamic.rs:206:45:
      called `Result::unwrap()` on an `Err` value: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-24 20:09:46 -05:00
Daniel Hill
326d7c1b3b improve kmalloc performance
Reading from /proc/meminfo is really slow

We don't want to start swapping to disk.

Deceptively, memory available goes up when we start to swap to disk making
performance even worse.

To mitigate this:
1. replace reading from meminfo with proper system calls.
2. attempt to lock allocations in physical memory space.
3. check our own allocated memory instead of available memory.
4. still check available memory in the off chance we're trying to play
nice with other apps.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-24 19:54:11 -05:00
Alexander Fougner
fbad1bfdf3 rust: fix MSRV build
- downgrade clap_completion to 4.3.x (1.65 compatible)
- dependency updates
- remove unused imports

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-11-23 19:29:43 +01:00
Kent Overstreet
06611a71a3 Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the command line
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-22 16:55:06 -05:00
Finn Behrens
e6b578917f nix: add bcachefs-fuse package
Add a fuseSupport argument and bcachefs-fuse as flake output with fuse enabled.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-20 15:13:17 -05:00
Zhai Can
b09d3a3356 fix manpage date
Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-18 14:53:17 -05:00
Zhai Can
07d4e0e864 manpage: add options for set-option
Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-18 14:53:17 -05:00
Zhai Can
0b5a8c239b update manpage
Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-18 14:53:17 -05:00
Kent Overstreet
c6e6954928 Fix build for cmd_fusemount.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-17 17:04:46 -05:00
Brian Foster
83bc15eefe bcachefs-tools: fix broken libblkid superblock wipe
When playing around with comparing some fstests results on different
filesystems, I noticed that a 'bcachefs format' of a previously
btrfs-formatted device still continued to mount as btrfs. The reason
for this is that the blkid wipe invoked via open_for_format() is not
working correctly. blkid_do_wipe() depends on the "SBMAGIC[_OFFSET]"
values to do any work, and the associated superblock magic flag is
not enabled on the probe.

Set the probe flags to explicitly enable the values the bcachefs
code depends on in the probe. This includes the type, label and
superblock magic information.

There are also a couple quirks in the libblkid code that might be
worth noting. One is that the superblock enablement and flag setting
functions appear hardcoded to return zero, so we just combine the
error checks. Second, while blkid_do_wipe() can return an error, it
actually doesn't in the scenario being addressed here because it
doesn't seem to distinguish between the values being absent because
nothing was found by the probe or because the values weren't enabled
in the first place. Regardless, add an error check here in the event
the wipe does explicitly fail for some unexpected reason.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-17 15:09:27 -05:00
Kent Overstreet
1331759db5 Bump rust edition to 2021
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-16 17:54:06 -05:00
Kent Overstreet
119d26bb10 delete dead code
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-16 17:54:06 -05:00
Kent Overstreet
689b4dd4f0 Update bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked() 2023-11-16 17:54:06 -05:00
Kent Overstreet
9776f9f362 Create COPYING.rust-dependencies in release tarballs
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-16 17:54:06 -05:00
Kent Overstreet
47bb2d53ce Version is now specified in the makefile
git describe doesn't work for tarball releases

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-16 15:24:22 -05:00
Kent Overstreet
7fd6c3ffe4 Update bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify optimistic spinning
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-12 20:57:28 -05:00
Finn Behrens
a613340b26 rust keylocation add none variant and implement ValueEnum
This enables a possible values help in the clap help text.

Signed-Off-By: Finn Behrens <me@kloenk.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-12 11:14:16 -05:00
Zhai Can
73da05d983
rust-cli: add help on list command 2023-11-10 21:20:17 +08:00
Zhai Can
1d1fe7b0b6
add command to generate Rust-part CLI completions 2023-11-10 21:20:01 +08:00
Finn Behrens
61134a06fa nix: add devShell
Add a nix devShell output to provide a development environment for nix users.

Signed-off-by: Finn Behrens <me@kloenk.de>
2023-11-09 23:13:43 +01:00
Finn Behrens
813310c343 nix: fix build add overlay and formatter to flake
Adds overlay flake output to expose the bcachefs package
and add and run a nix formatter.

Co-authored-by: Leona Maroni <dev@leona.is>
Signed-off-by: Leona Maroni <dev@leona.is>
Signed-off-by: Finn Behrens <me@kloenk.de>
2023-11-09 22:09:33 +01:00
Nicholas Sielicki
81352a29bc btree_write_buffer: ensure atomic64_sub_return_release availability
prior to this patch, on certain platforms (ie: armv7l), compilation fails due
to atomic64_sub_return_release not being defined here. Ensure that the atomics
header is pulled in, and ensure that it is available in all cases, regardless
of whether ATOMIC64_SPINLOCK is defined.

Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-08 11:32:40 -05:00
Nicholas Sielicki
974d9bf000 rust: mount: use libc::c_ulong for flags
libc proper treats mount flags as an unsigned long, which is usually u64,
except when it isn't. When preparing mount flags, use the libc::c_ulong type
instead of u64 to allow for this.

This fixes compiling this file under armv7l.

Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-08 11:32:36 -05:00
Kent Overstreet
29e27cc492 Fix build on 32 bit
size_t is apparently not an unsigned long on 32 bit, which is what
rounddown_pow_of_two() returns.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-07 21:17:06 -05:00
Kent Overstreet
d6d1d8e519 make-release-tarball.sh
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-07 19:33:41 -05:00
Alexander Fougner
8f4361b686 ci: skip install of recommended packages
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-11-07 20:02:43 +01:00
Alexander Fougner
04666325d4 ci: bump github actions
- cachix/install-nix-action v22 -> v23
- actions/checkout v3 -> v4

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-11-07 20:02:43 +01:00
Kent Overstreet
469e8eb008 Avoiding picking different bucket sizes for different devices
Erasure coding can't create stripes across devices with different bucket
sizes - therefore, format shouldn't pick different bucket sizes for
different devices.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-06 20:47:48 -05:00
Kent Overstreet
a0371350ef Fix build for cmd_fusermount.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-06 19:06:34 -05:00
Kent Overstreet
cc902bb4bf cmd_format: Check for device options after device arguments
It's a common user error to specify device specific options at the end
of a format command, and then not have them apply to any devices - add a
check for this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-06 19:02:40 -05:00
Alexander Fougner
26efa5cf2e downgrade rust deps to compile for MSRV
- add helper for cargo update, whilst respecting MSRV

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-11-04 20:29:28 -04:00
Kent Overstreet
13a9480722 Update bcachefs sources to d464ec667b2b bcachefs: Add missing printk newlines 2023-11-03 12:09:59 -04:00
Kent Overstreet
37ee7f0591 Update, slim down rust dependencies
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-02 16:44:59 -04:00
Kent Overstreet
0a08ddf78c Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enum 2023-11-02 14:39:01 -04:00
Kent Overstreet
d320a4e927 Update bcachefs sources to 6628827a8707 bcachefs: Skip deleted members in member_to_text() 2023-10-27 19:38:36 -04:00
Kent Overstreet
8eaf8ddf45 Update bcachefs sources to 7250b2ee5574 bcachefs: Fix deleted inodes btree in snapshot deletion 2023-10-27 16:43:11 -04:00
Kent Overstreet
9799b119c3 Update bcachefs sources to 0d63ed13ea3d closures: Fix race in closure_sync()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-25 13:59:16 -04:00
Kent Overstreet
bd9e015334 Update bcachefs sources to f70a3402188e bcachefs: Fix ca->oldest_gen allocation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-20 13:25:06 -04:00