Commit Graph

1127 Commits

Author SHA1 Message Date
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
Kent Overstreet
2252eecec7 Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19 22:56:59 -04:00
Kent Overstreet
6a34032417 Update bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into direct assignment
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-18 22:14:53 -04:00
Hunter Shaffer
9f98746bfc 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>
2023-10-08 21:06:07 -04:00
Hunter Shaffer
b2ffa12074 deleted unused path to device in get_size, get_blocksize
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
2023-10-08 21:06:07 -04:00
Kent Overstreet
1251ea58a8 Update bcachefs sources to 7bf1ac0d46 bcachefs: Correctly initialize new buckets on device resize
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
2023-10-08 21:06:07 -04:00
Kent Overstreet
6b175a0224 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>
2023-09-29 01:27:59 -04:00
Kent Overstreet
5e215654da Update bcachefs sources to a1b6677dca57 bcachefs: Fix looping around bch2_propagate_key_to_snapshot_leaves() 2023-09-26 17:12:51 -04:00
Kent Overstreet
1e358401ec Update bcachefs sources to 1336a995cbc3 bcachefs: Silence transaction restart error message 2023-09-26 13:29:49 -04:00
Kent Overstreet
6e8f2857af Create symlinks on install with ln -sf
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-26 01:05:29 -04:00
Kent Overstreet
a053ebfb8c Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in userspace
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-23 20:03:23 -04:00
Kent Overstreet
731926b5e5 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>
2023-09-22 14:09:51 -04:00
Brian Foster
f76c449ec0 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>
2023-09-19 17:26:45 -04:00
Brian Foster
f68e0ed16e 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>
2023-09-19 16:15:56 -04:00
Colin Gillespie
9fe08ba354 cmd_mount: request passphrase if the existing key is revoked
Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
2023-09-08 04:05:39 -04:00
Colin Gillespie
8d5e53b88a 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>
2023-09-08 04:05:36 -04:00
Christopher James Halse Rogers
28e6dea653 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>
2023-09-03 18:27:10 -04:00
Torge Matthies
e0e3032926
Fix one second delay when exiting
Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
2023-09-01 17:51:31 +02:00
Kent Overstreet
63c8f14756 Update bcachefs sources to e7f6215768 bcachefs: Fix snapshot_skiplist_good() 2023-08-28 15:20:58 -04:00
Kent Overstreet
63747ac653 Fix null ptr deref in bbpos_parse()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-08-22 15:45:35 -04:00
Kent Overstreet
54b6beabf0 Update bcachefs sources to bed61fae3b bcachefs: Delete a faulty assertion 2023-08-18 00:07:51 -04:00
Kent Overstreet
505c326cbe Update bcachefs sources to a8115093df bcachefs: Fix divide by zero in rebalance_work() 2023-08-17 17:11:27 -04:00
Colin Gillespie
4d04fe4262 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>
2023-08-12 12:06:24 -04:00
Kent Overstreet
f3976e3733 Update bcachefs sources to b0788c47d9 bcachefs: Fix check_version_upgrade() 2023-08-11 22:25:12 -04:00
Kent Overstreet
bcee0320dc 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>
2023-08-11 18:32:23 -04:00
Kent Overstreet
ae23e4541f 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>
2023-08-11 18:32:23 -04:00
Linus Heckemann
0de1fb41b7 cmd_mount: don't return 0 on mount failure
Signed-off-by: Linus Heckemann <git@sphalerite.org>
2023-08-10 11:01:24 -04:00
Kent Overstreet
9d26fad294 fuse: Update for snapshots
cmd_fusermount.c builds again

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-08-08 20:29:57 -04:00
Kent Overstreet
15b24c7327 Update bcachefs sources to 717b356d1d bcachefs: Convert journal validation to bkey_invalid_flags
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-08-06 13:08:36 -04:00
Alexander Fougner
caeeba5152 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>
2023-08-04 20:13:38 +02:00
Alexander Fougner
a3087defd8 Remove sparse protocol envvar
Default as of rust 1.70

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-08-04 20:13:38 +02:00
Kent Overstreet
8885dbe8df cmd_dump: Making dumping the entire journal the default
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-08-03 17:20:13 -04:00
Kent Overstreet
bafc817a3f Update bcachefs sources to 5b8c4a1366 bcachefs: bcachefs_metadata_version_deleted_inodes 2023-08-03 13:26:22 -04:00
Kent Overstreet
87179c7a6e Update bcachefs sources to 33a60d9b05 bcachefs: Assorted fixes for clang 2023-08-01 22:13:03 -04:00
Kent Overstreet
2d7982de78 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>
2023-08-01 16:57:52 -04:00
Kent Overstreet
3e39c57c70 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>
2023-08-01 16:57:00 -04:00
Kent Overstreet
71ed9f183b Run shrinkers when pthread_create fails
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-20 21:28:03 -04:00
Kent Overstreet
ded0160563 Update bcachefs sources to 4b5917839c bcachefs: Fix a null ptr deref in check_xattr() 2023-07-20 19:37:48 -04:00
Kent Overstreet
e8e60b982d Fix 'bcachefs fsck -y'
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-20 18:11:51 -04:00
Kent Overstreet
44fc32e7ef Update bcachefs sources to ee560a3929 bcachefs: Print version, options earlier in startup path 2023-07-20 18:09:44 -04:00
Alexander Fougner
a7b0ba44f0 ci: upgrade to checkout action v3
v2 is deprecated

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-07-20 22:27:56 +02:00
Jörg Thalheim
faec58a713 .gitignore: replace travis with github-ci config 2023-07-20 22:27:56 +02:00
Jörg Thalheim
2bbb23812c add dependabot config to keep github ci actions up-to-date 2023-07-20 22:27:56 +02:00
Jörg Thalheim
73dd04c059 ci: unpin nix install url
I don't think we no longer need this and the install-nix-action
is not compatible with it.
2023-07-20 22:27:56 +02:00
Jörg Thalheim
23c2c8832a ci: bump install-nix-action/cachix to fix nixos build
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
2023-07-20 22:27:56 +02:00
Kent Overstreet
c8bec83e30 Update bcachefs sources to e14d7c7195 bcachefs: Compression levels
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-15 17:36:15 -04:00
Demi Marie Obenour
1c156d5c46 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>
2023-07-10 16:03:30 -04:00
Kent Overstreet
ee1d223ab2 Update bcachefs sources to 04f2d2ae5b bcachefs: Fix build error on weird gcc 2023-07-10 15:57:09 -04:00
Kent Overstreet
21ae8a4b71 Update bcachefs sources to 070ec8d07b bcachefs: Snapshot depth, skiplist fields
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-10 14:27:14 -04:00