]> git.sesse.net Git - bcachefs-tools-debian/log
bcachefs-tools-debian
6 months agoUpdate bcachefs sources to 676dd269f0f8 mean and variance: Promote to lib/math
Kent Overstreet [Thu, 30 Nov 2023 03:42:52 +0000 (22:42 -0500)]
Update bcachefs sources to 676dd269f0f8 mean and variance: Promote to lib/math

6 months agoUpdate bcachefs sources to eb83f1f842bb mean and variance: Promote to lib/math
Kent Overstreet [Thu, 30 Nov 2023 03:00:41 +0000 (22:00 -0500)]
Update bcachefs sources to eb83f1f842bb mean and variance: Promote to lib/math

6 months agoadd a fallback __DECLARE_FLEX_ARRAY
Kent Overstreet [Wed, 29 Nov 2023 22:41:06 +0000 (17:41 -0500)]
add a fallback __DECLARE_FLEX_ARRAY

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoUpdate bcachefs sources to c3e4d892b77b mean and variance: Promote to lib/math
Kent Overstreet [Wed, 29 Nov 2023 22:00:30 +0000 (17:00 -0500)]
Update bcachefs sources to c3e4d892b77b mean and variance: Promote to lib/math

6 months agoman: Fix cmd-option format
Brett Holman [Mon, 27 Nov 2023 20:22:59 +0000 (13:22 -0700)]
man: Fix cmd-option format

Options prgquote and degraded only had a single leading hyphen.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agobcachefs-tools: don't skip stale superblock wipe in force mode
Brian Foster [Mon, 27 Nov 2023 18:31:10 +0000 (13:31 -0500)]
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>
6 months agocmd_list_journal: Apply star_start_of_lines() correctly
Kent Overstreet [Mon, 27 Nov 2023 18:35:08 +0000 (13:35 -0500)]
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>
6 months agoUpdate bcachefs sources to feaca6edbd24 mean and variance: Promote to lib/math
Kent Overstreet [Mon, 27 Nov 2023 03:33:04 +0000 (22:33 -0500)]
Update bcachefs sources to feaca6edbd24 mean and variance: Promote to lib/math

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoConvert to BCH_IOCTL_DEV_USAGE_V2
Kent Overstreet [Fri, 24 Nov 2023 00:42:47 +0000 (19:42 -0500)]
Convert to BCH_IOCTL_DEV_USAGE_V2

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoUpdate bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entr...
Kent Overstreet [Sun, 26 Nov 2023 02:51:30 +0000 (21:51 -0500)]
Update bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entry_data_usage

6 months agocmd_fs_usage: Print out replica set durability
Kent Overstreet [Sat, 25 Nov 2023 01:50:49 +0000 (20:50 -0500)]
cmd_fs_usage: Print out replica set durability

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agodocs: mention that libclang is required
Alexander Batischev [Thu, 23 Nov 2023 18:37:16 +0000 (21:37 +0300)]
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>
6 months agoimprove kmalloc performance
Daniel Hill [Mon, 20 Nov 2023 12:43:52 +0000 (01:43 +1300)]
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>
6 months agorust: fix MSRV build
Alexander Fougner [Thu, 23 Nov 2023 18:22:47 +0000 (19:22 +0100)]
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>
6 months agoUpdate bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the comma...
Kent Overstreet [Tue, 21 Nov 2023 00:33:52 +0000 (19:33 -0500)]
Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the command line

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agonix: add bcachefs-fuse package
Finn Behrens [Sun, 19 Nov 2023 21:13:14 +0000 (22:13 +0100)]
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>
6 months agofix manpage date
Zhai Can [Sat, 18 Nov 2023 07:29:22 +0000 (15:29 +0800)]
fix manpage date

Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agomanpage: add options for `set-option`
Zhai Can [Fri, 17 Nov 2023 08:43:26 +0000 (16:43 +0800)]
manpage: add options for `set-option`

Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoupdate manpage
Zhai Can [Fri, 17 Nov 2023 08:30:18 +0000 (16:30 +0800)]
update manpage

Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoFix build for cmd_fusemount.c
Kent Overstreet [Fri, 17 Nov 2023 22:04:46 +0000 (17:04 -0500)]
Fix build for cmd_fusemount.c

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agobcachefs-tools: fix broken libblkid superblock wipe
Brian Foster [Fri, 17 Nov 2023 13:12:58 +0000 (08:12 -0500)]
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>
6 months agoBump rust edition to 2021
Kent Overstreet [Thu, 16 Nov 2023 21:33:47 +0000 (16:33 -0500)]
Bump rust edition to 2021

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agodelete dead code
Kent Overstreet [Thu, 16 Nov 2023 20:47:59 +0000 (15:47 -0500)]
delete dead code

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoUpdate bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked()
Kent Overstreet [Thu, 16 Nov 2023 20:47:11 +0000 (15:47 -0500)]
Update bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked()

6 months agoCreate COPYING.rust-dependencies in release tarballs
Kent Overstreet [Thu, 16 Nov 2023 20:45:12 +0000 (15:45 -0500)]
Create COPYING.rust-dependencies in release tarballs

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoVersion is now specified in the makefile
Kent Overstreet [Thu, 16 Nov 2023 20:24:22 +0000 (15:24 -0500)]
Version is now specified in the makefile

git describe doesn't work for tarball releases

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoUpdate bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify optimistic...
Kent Overstreet [Mon, 13 Nov 2023 01:53:57 +0000 (20:53 -0500)]
Update bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify optimistic spinning

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agorust keylocation add none variant and implement ValueEnum
Finn Behrens [Sun, 12 Nov 2023 16:12:36 +0000 (17:12 +0100)]
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>
7 months agorust-cli: add help on `list` command
Zhai Can [Fri, 10 Nov 2023 12:42:35 +0000 (20:42 +0800)]
rust-cli: add help on `list` command

7 months agoadd command to generate Rust-part CLI completions
Zhai Can [Fri, 10 Nov 2023 12:13:03 +0000 (20:13 +0800)]
add command to generate Rust-part CLI completions

7 months agonix: add devShell
Finn Behrens [Sun, 5 Nov 2023 10:44:27 +0000 (11:44 +0100)]
nix: add devShell

Add a nix devShell output to provide a development environment for nix users.

Signed-off-by: Finn Behrens <me@kloenk.de>
7 months agonix: fix build add overlay and formatter to flake
Finn Behrens [Sat, 4 Nov 2023 08:40:16 +0000 (09:40 +0100)]
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>
7 months agobtree_write_buffer: ensure atomic64_sub_return_release availability
Nicholas Sielicki [Thu, 19 Oct 2023 04:39:04 +0000 (23:39 -0500)]
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>
7 months agorust: mount: use libc::c_ulong for flags
Nicholas Sielicki [Wed, 18 Oct 2023 05:59:02 +0000 (00:59 -0500)]
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>
7 months agoFix build on 32 bit
Kent Overstreet [Wed, 8 Nov 2023 02:17:06 +0000 (21:17 -0500)]
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>
7 months agomake-release-tarball.sh
Kent Overstreet [Wed, 8 Nov 2023 00:33:41 +0000 (19:33 -0500)]
make-release-tarball.sh

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agoci: skip install of recommended packages
Alexander Fougner [Fri, 11 Aug 2023 16:50:43 +0000 (18:50 +0200)]
ci: skip install of recommended packages

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
7 months agoci: bump github actions
Alexander Fougner [Mon, 6 Nov 2023 18:52:05 +0000 (19:52 +0100)]
ci: bump github actions

- cachix/install-nix-action v22 -> v23
- actions/checkout v3 -> v4

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
7 months agoAvoiding picking different bucket sizes for different devices
Kent Overstreet [Tue, 7 Nov 2023 01:47:48 +0000 (20:47 -0500)]
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>
7 months agoFix build for cmd_fusermount.c
Kent Overstreet [Tue, 7 Nov 2023 00:06:34 +0000 (19:06 -0500)]
Fix build for cmd_fusermount.c

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agocmd_format: Check for device options after device arguments
Kent Overstreet [Tue, 7 Nov 2023 00:01:15 +0000 (19:01 -0500)]
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>
7 months agodowngrade rust deps to compile for MSRV
Alexander Fougner [Sun, 5 Nov 2023 00:07:01 +0000 (01:07 +0100)]
downgrade rust deps to compile for MSRV

- add helper for cargo update, whilst respecting MSRV

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
7 months agoUpdate bcachefs sources to d464ec667b2b bcachefs: Add missing printk newlines
Kent Overstreet [Fri, 3 Nov 2023 16:09:59 +0000 (12:09 -0400)]
Update bcachefs sources to d464ec667b2b bcachefs: Add missing printk newlines

7 months agoUpdate, slim down rust dependencies
Kent Overstreet [Thu, 2 Nov 2023 20:44:59 +0000 (16:44 -0400)]
Update, slim down rust dependencies

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agoUpdate bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enum
Kent Overstreet [Thu, 2 Nov 2023 18:39:01 +0000 (14:39 -0400)]
Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enum

7 months agoUpdate bcachefs sources to 6628827a8707 bcachefs: Skip deleted members in member_to_t...
Kent Overstreet [Fri, 27 Oct 2023 23:38:36 +0000 (19:38 -0400)]
Update bcachefs sources to 6628827a8707 bcachefs: Skip deleted members in member_to_text()

7 months agoUpdate bcachefs sources to 7250b2ee5574 bcachefs: Fix deleted inodes btree in snapsho...
Kent Overstreet [Fri, 27 Oct 2023 20:43:11 +0000 (16:43 -0400)]
Update bcachefs sources to 7250b2ee5574 bcachefs: Fix deleted inodes btree in snapshot deletion

7 months agoUpdate bcachefs sources to 0d63ed13ea3d closures: Fix race in closure_sync()
Kent Overstreet [Wed, 25 Oct 2023 06:09:44 +0000 (02:09 -0400)]
Update bcachefs sources to 0d63ed13ea3d closures: Fix race in closure_sync()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agoUpdate bcachefs sources to f70a3402188e bcachefs: Fix ca->oldest_gen allocation
Kent Overstreet [Fri, 20 Oct 2023 04:02:31 +0000 (00:02 -0400)]
Update bcachefs sources to f70a3402188e bcachefs: Fix ca->oldest_gen allocation

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agoUpdate bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str()
Kent Overstreet [Fri, 20 Oct 2023 02:52:02 +0000 (22:52 -0400)]
Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 months agoUpdate bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into direct assignment
Kent Overstreet [Thu, 19 Oct 2023 01:57:11 +0000 (21:57 -0400)]
Update bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into direct assignment

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
8 months agoChange open_for_format to the block io api
Hunter Shaffer [Tue, 29 Aug 2023 22:05:09 +0000 (18:05 -0400)]
Change open_for_format to the block io api

Upcoming patch will add device benchmarking at format time, which needs
the bio API.

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
8 months agodeleted unused path to device in get_size, get_blocksize
Hunter Shaffer [Tue, 29 Aug 2023 21:32:55 +0000 (17:32 -0400)]
deleted unused path to device in get_size, get_blocksize

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
8 months agoUpdate bcachefs sources to 7bf1ac0d46 bcachefs: Correctly initialize new buckets...
Kent Overstreet [Sat, 7 Oct 2023 21:23:13 +0000 (17:23 -0400)]
Update bcachefs sources to 7bf1ac0d46 bcachefs: Correctly initialize new buckets on device resize

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
8 months agoHandle -EAGAIN from io_submit()
Kent Overstreet [Fri, 29 Sep 2023 05:27:59 +0000 (01:27 -0400)]
Handle -EAGAIN from io_submit()

If io_submit() returns -EAGAIN, that just means the io context is full
and we need to wait for completions - no need to die.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
8 months agoUpdate bcachefs sources to a1b6677dca57 bcachefs: Fix looping around bch2_propagate_k...
Kent Overstreet [Tue, 26 Sep 2023 21:12:51 +0000 (17:12 -0400)]
Update bcachefs sources to a1b6677dca57 bcachefs: Fix looping around bch2_propagate_key_to_snapshot_leaves()

8 months agoUpdate bcachefs sources to 1336a995cbc3 bcachefs: Silence transaction restart error...
Kent Overstreet [Tue, 26 Sep 2023 17:29:49 +0000 (13:29 -0400)]
Update bcachefs sources to 1336a995cbc3 bcachefs: Silence transaction restart error message

8 months agoCreate symlinks on install with ln -sf
Kent Overstreet [Tue, 26 Sep 2023 05:05:29 +0000 (01:05 -0400)]
Create symlinks on install with ln -sf

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
8 months agoUpdate bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in userspace
Kent Overstreet [Sat, 23 Sep 2023 22:42:30 +0000 (18:42 -0400)]
Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in userspace

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
8 months agoKill shell script wrappers
Kent Overstreet [Fri, 22 Sep 2023 18:06:55 +0000 (14:06 -0400)]
Kill shell script wrappers

nixos has trouble with the shell script wrappers - readlink isn't
available by default!

But, there's a better approach: just get rid of them and use symlinks
instead, and have main() check what we're supposed to be.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
8 months agobcachefs-tools: fix endian problems between bit spinlocks and futexes
Brian Foster [Tue, 19 Sep 2023 14:26:11 +0000 (10:26 -0400)]
bcachefs-tools: fix endian problems between bit spinlocks and futexes

bcachefs format on a big-endian (s390x) machine crashes down in the
rhashtable code imported from the kernel. The reason this occurs
lies within the rht_lock() -> bit_spin_lock() code, the latter of
which casts bitmaps down to 32-bits to satisfy the requirements of
the futex interface.

The specific problem here is that a 64 -> 32 bit cast doesn't refer
to the lower 8 bytes on a big endian machine, which means setting
bit number 0 in the 32-bit map actually corresponds to bit 32 in the
64-bit map. The rhashtable code specifically uses bit zero of the
bucket pointer for exclusion and uses native bitops elsewhere (i.e.
__rht_ptr()) to identify NULL pointers. If bit 32 of the pointer is
set by the locking code instead of bit 0, an otherwise NULL pointer
looks like a non-NULL value and results in a segfault.

The bit spinlock code imported by the kernel is originally intended
to work with unsigned long. The kernel code is able to throttle the
cpu directly when under lock contention, while the userspace
implementation relies on the futex primitives to emulate reliable
blocking. Since the futex interface introduces the 32-bit
requirement, isolate the associated userspace hack to that
particular code.

Restore the native bitmap behavior of the bit spinlock code to
address the rhashtable problem described above. Since this is not
compatible with the futex interface, create a futex wrapper
specifically to convert the native bitmap type to a 32-bit virtual
address and mask value for the purposes of waiting/waking when under
lock contention.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
8 months agolibbcachefs: convert sb features mask to little endian
Brian Foster [Fri, 15 Sep 2023 13:40:25 +0000 (09:40 -0400)]
libbcachefs: convert sb features mask to little endian

bch_sb.features is an array of __le64. Convert the native endian format
of the features mask appropriately. This causes a bcachefs format to
produce an unmountable fs when run from a big endian system.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
9 months agocmd_mount: request passphrase if the existing key is revoked
Colin Gillespie [Fri, 8 Sep 2023 07:27:52 +0000 (17:27 +1000)]
cmd_mount: request passphrase if the existing key is revoked

Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
9 months agocmd_set_passphrase: revoke the invalidated key
Colin Gillespie [Fri, 8 Sep 2023 07:27:51 +0000 (17:27 +1000)]
cmd_set_passphrase: revoke the invalidated key

After setting a new passphrase, the previous key is left untouched. This
revokes the old key, preventing future actions from using it in error.

Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
9 months agocmd_mount: Fix test-only mount path
Christopher James Halse Rogers [Fri, 1 Sep 2023 06:51:32 +0000 (16:51 +1000)]
cmd_mount: Fix test-only mount path

The comman line help claims that `bcachefs mount <DEV>` without a
mount point will do a dry-run mount - all the steps required to
mount the fs, but without actually doing the final real mount.

Make the code actually do this, rather than complain that you
haven't supplied a mountpoint if you don't provide a mountpoint

Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
9 months agoFix one second delay when exiting
Torge Matthies [Fri, 1 Sep 2023 15:51:31 +0000 (17:51 +0200)]
Fix one second delay when exiting

Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
9 months agoUpdate bcachefs sources to e7f6215768 bcachefs: Fix snapshot_skiplist_good()
Kent Overstreet [Mon, 28 Aug 2023 19:20:58 +0000 (15:20 -0400)]
Update bcachefs sources to e7f6215768 bcachefs: Fix snapshot_skiplist_good()

9 months agoFix null ptr deref in bbpos_parse()
Kent Overstreet [Tue, 22 Aug 2023 19:45:35 +0000 (15:45 -0400)]
Fix null ptr deref in bbpos_parse()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
9 months agoUpdate bcachefs sources to bed61fae3b bcachefs: Delete a faulty assertion
Kent Overstreet [Fri, 18 Aug 2023 04:07:51 +0000 (00:07 -0400)]
Update bcachefs sources to bed61fae3b bcachefs: Delete a faulty assertion

9 months agoUpdate bcachefs sources to a8115093df bcachefs: Fix divide by zero in rebalance_work()
Kent Overstreet [Thu, 17 Aug 2023 21:08:33 +0000 (17:08 -0400)]
Update bcachefs sources to a8115093df bcachefs: Fix divide by zero in rebalance_work()

10 months agocmd_mount: use the correct keyring key type
Colin Gillespie [Sat, 12 Aug 2023 03:50:37 +0000 (13:50 +1000)]
cmd_mount: use the correct keyring key type

Mount is checking for and adding encryption keys using the logon key
type instead of the user key type. This was causing it to not be able to
unlock volumes on its own, and ask for a passphrase on already unlocked
volumes.

Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
10 months agoUpdate bcachefs sources to b0788c47d9 bcachefs: Fix check_version_upgrade()
Kent Overstreet [Sat, 12 Aug 2023 02:22:59 +0000 (22:22 -0400)]
Update bcachefs sources to b0788c47d9 bcachefs: Fix check_version_upgrade()

10 months agocmd_dump: Also set read_only
Kent Overstreet [Fri, 11 Aug 2023 22:17:07 +0000 (18:17 -0400)]
cmd_dump: Also set read_only

In nochanges mode, without read_only, we can go into a fake rw mode
where we allow writes but hold them in memory.

That's not what we want for the dump tool - this fixes a bug where btree
nodes don't always get dumped correctly.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agofuse: Set fsname correctly
Kent Overstreet [Fri, 11 Aug 2023 22:16:14 +0000 (18:16 -0400)]
fuse: Set fsname correctly

Also, add helpers for the fuse.bcachefs filesystem type; this means we
can now test the fuse version with fstests.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agocmd_mount: don't return 0 on mount failure
Linus Heckemann [Thu, 10 Aug 2023 13:22:25 +0000 (15:22 +0200)]
cmd_mount: don't return 0 on mount failure

Signed-off-by: Linus Heckemann <git@sphalerite.org>
10 months agofuse: Update for snapshots
Kent Overstreet [Tue, 8 Aug 2023 21:42:16 +0000 (17:42 -0400)]
fuse: Update for snapshots

cmd_fusermount.c builds again

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agoUpdate bcachefs sources to 717b356d1d bcachefs: Convert journal validation to bkey_in...
Kent Overstreet [Sat, 5 Aug 2023 22:06:22 +0000 (18:06 -0400)]
Update bcachefs sources to 717b356d1d bcachefs: Convert journal validation to bkey_invalid_flags

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agoci: set and verify MSRV
Alexander Fougner [Fri, 21 Jul 2023 09:41:54 +0000 (11:41 +0200)]
ci: set and verify MSRV

To prevent uncontrolled usage of new rust features, directly or from
dependencies, set a minimum supported Rust version and verify it builds.

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
10 months agoRemove sparse protocol envvar
Alexander Fougner [Thu, 22 Jun 2023 17:09:16 +0000 (19:09 +0200)]
Remove sparse protocol envvar

Default as of rust 1.70

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
10 months agocmd_dump: Making dumping the entire journal the default
Kent Overstreet [Thu, 3 Aug 2023 21:19:48 +0000 (17:19 -0400)]
cmd_dump: Making dumping the entire journal the default

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agoUpdate bcachefs sources to 5b8c4a1366 bcachefs: bcachefs_metadata_version_deleted_inodes
Kent Overstreet [Thu, 3 Aug 2023 17:26:22 +0000 (13:26 -0400)]
Update bcachefs sources to 5b8c4a1366 bcachefs: bcachefs_metadata_version_deleted_inodes

10 months agoUpdate bcachefs sources to 33a60d9b05 bcachefs: Assorted fixes for clang
Kent Overstreet [Wed, 2 Aug 2023 00:18:33 +0000 (20:18 -0400)]
Update bcachefs sources to 33a60d9b05 bcachefs: Assorted fixes for clang

10 months agocmd_list_journal: Tweak extent matching
Kent Overstreet [Tue, 1 Aug 2023 20:57:52 +0000 (16:57 -0400)]
cmd_list_journal: Tweak extent matching

Extents can now additionally be matched by the end position, the same as
normal keys.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agobpos_parse() now handles symbol constants
Kent Overstreet [Tue, 1 Aug 2023 20:57:00 +0000 (16:57 -0400)]
bpos_parse() now handles symbol constants

We can now parse U32_MAX/U64_MAX, as printed by bch2_bpos_to_text().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agoRun shrinkers when pthread_create fails
Kent Overstreet [Fri, 21 Jul 2023 01:28:03 +0000 (21:28 -0400)]
Run shrinkers when pthread_create fails

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agoUpdate bcachefs sources to 4b5917839c bcachefs: Fix a null ptr deref in check_xattr()
Kent Overstreet [Thu, 20 Jul 2023 23:37:48 +0000 (19:37 -0400)]
Update bcachefs sources to 4b5917839c bcachefs: Fix a null ptr deref in check_xattr()

10 months agoFix 'bcachefs fsck -y'
Kent Overstreet [Thu, 20 Jul 2023 22:11:51 +0000 (18:11 -0400)]
Fix 'bcachefs fsck -y'

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
10 months agoUpdate bcachefs sources to ee560a3929 bcachefs: Print version, options earlier in...
Kent Overstreet [Thu, 20 Jul 2023 22:09:44 +0000 (18:09 -0400)]
Update bcachefs sources to ee560a3929 bcachefs: Print version, options earlier in startup path

10 months agoci: upgrade to checkout action v3
Alexander Fougner [Thu, 20 Jul 2023 19:35:47 +0000 (21:35 +0200)]
ci: upgrade to checkout action v3

v2 is deprecated

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
10 months ago.gitignore: replace travis with github-ci config
Jörg Thalheim [Sun, 18 Jun 2023 12:23:28 +0000 (19:23 +0700)]
.gitignore: replace travis with github-ci config

10 months agoadd dependabot config to keep github ci actions up-to-date
Jörg Thalheim [Sun, 18 Jun 2023 12:22:57 +0000 (19:22 +0700)]
add dependabot config to keep github ci actions up-to-date

10 months agoci: unpin nix install url
Jörg Thalheim [Sun, 18 Jun 2023 12:19:24 +0000 (19:19 +0700)]
ci: unpin nix install url

I don't think we no longer need this and the install-nix-action
is not compatible with it.

10 months agoci: bump install-nix-action/cachix to fix nixos build
Jörg Thalheim [Sun, 18 Jun 2023 12:14:49 +0000 (19:14 +0700)]
ci: bump install-nix-action/cachix to fix nixos build

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
10 months agoUpdate bcachefs sources to e14d7c7195 bcachefs: Compression levels
Kent Overstreet [Tue, 11 Jul 2023 00:31:34 +0000 (20:31 -0400)]
Update bcachefs sources to e14d7c7195 bcachefs: Compression levels

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoAdd additional information about encryption
Demi Marie Obenour [Sat, 10 Jun 2023 20:43:31 +0000 (16:43 -0400)]
Add additional information about encryption

This adds additional details about how encryption works in
bcachefs, along with a warning regarding snapshots.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
11 months agoUpdate bcachefs sources to 04f2d2ae5b bcachefs: Fix build error on weird gcc
Kent Overstreet [Mon, 10 Jul 2023 19:57:09 +0000 (15:57 -0400)]
Update bcachefs sources to 04f2d2ae5b bcachefs: Fix build error on weird gcc

11 months agoUpdate bcachefs sources to 070ec8d07b bcachefs: Snapshot depth, skiplist fields
Kent Overstreet [Mon, 10 Jul 2023 18:17:18 +0000 (14:17 -0400)]
Update bcachefs sources to 070ec8d07b bcachefs: Snapshot depth, skiplist fields

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to fb39031ade bcachefs: bch2_sb_maybe_downgrade(), bch2_sb_up...
Kent Overstreet [Mon, 10 Jul 2023 16:23:51 +0000 (12:23 -0400)]
Update bcachefs sources to fb39031ade bcachefs: bch2_sb_maybe_downgrade(), bch2_sb_upgrade()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to 1e3ca87f7b bcachefs: bcachefs_metadata_version_major_minor
Kent Overstreet [Mon, 10 Jul 2023 05:44:55 +0000 (01:44 -0400)]
Update bcachefs sources to 1e3ca87f7b bcachefs: bcachefs_metadata_version_major_minor

11 months agoUpdate bcachefs sources to da7d42a9a2 bcachefs: Add new assertions for shutdown path
Kent Overstreet [Sun, 9 Jul 2023 19:16:50 +0000 (15:16 -0400)]
Update bcachefs sources to da7d42a9a2 bcachefs: Add new assertions for shutdown path

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>