Age | Commit message (Collapse) | Author | Files | Lines |
|
The unending stream of syzbot bug reports and overwrought filing of CVEs
for corner case handling (i.e. things that distract from actual user
complaints) in XFS has generated all sorts of of overheated rhetoric
about how every bug is a Serious Security Issue(tm) because anyone can
craft a malicious filesystem on a USB stick, insert the stick into a
victim machine, and mount will trigger a bug in the kernel driver that
leads to some compromise or DoS or something.
I thought that nobody would be foolish enough to automount an XFS
filesystem. What a fool I was! It turns out that udisks can be told
that it's okay to automount things, and then GNOME will do exactly that.
Including mounting mangled XFS filesystems! Same with bcachefs!
<delete angry rant about poor decisionmaking and armchair fs developers
blasting us on X while not actually doing any of the work>
Turn off /this/ idiocy by adding a udev rule to tell udisks not to
automount bcachefs filesystems.
This will not stop a logged in user from unwittingly inserting a
malicious storage device and pressing [mount] and getting breached.
This is not a substitute for a thorough audit. This is not a substitute
for lklfuse. This does not solve the general problem of in-kernel fs
drivers being a huge attack surface. I just want to give Kent a break
from some of the oceans of bu******.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
flush check more rigorous
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
Options prgquote and degraded only had a single leading hyphen.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
jset_entry_data_usage
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
- downgrade clap_completion to 4.3.x (1.65 compatible)
- dependency updates
- remove unused imports
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
the command line
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
__kern_path_locked()
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
git describe doesn't work for tarball releases
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
optimistic spinning
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
|
|
|
|
Add a nix devShell output to provide a development environment for nix users.
Signed-off-by: Finn Behrens <me@kloenk.de>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
- cachix/install-nix-action v22 -> v23
- actions/checkout v3 -> v4
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
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>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
- add helper for cargo update, whilst respecting MSRV
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
member_to_text()
|
|
in snapshot deletion
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
direct assignment
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Upcoming patch will add device benchmarking at format time, which needs
the bio API.
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
|
|
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
|
|
buckets on device resize
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
|
|
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>
|
|
bch2_propagate_key_to_snapshot_leaves()
|
|
restart error message
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
userspace
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
|
|
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>
|
|
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>
|
|
Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
|
|
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
rebalance_work()
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
Signed-off-by: Linus Heckemann <git@sphalerite.org>
|
|
cmd_fusermount.c builds again
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
to bkey_invalid_flags
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
Default as of rust 1.70
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bcachefs_metadata_version_deleted_inodes
|
|
|
|
Extents can now additionally be matched by the end position, the same as
normal keys.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
We can now parse U32_MAX/U64_MAX, as printed by bch2_bpos_to_text().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
check_xattr()
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
earlier in startup path
|
|
v2 is deprecated
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
|
|
|
|
I don't think we no longer need this and the install-nix-action
is not compatible with it.
|
|
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
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>
|
|
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bch2_sb_upgrade()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bcachefs_metadata_version_major_minor
|
|
shutdown path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
types
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
into multiple functions
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bch2_check_discard_freespace_key()
|
|
bch2_check_discard_freespace_key()
|
|
CLOCK_MONOTONIC requires a syscall, and is much more expensive.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
|
|
This is needed so that nix-update can update cargo dependencies.
Flake lock file updates:
• Updated input 'nixpkgs':
'github:nixos/nixpkgs/b1f87ca164a9684404c8829b851c3586c4d9f089' (2023-02-25)
→ 'github:nixos/nixpkgs/0eeebd64de89e4163f4d3cf34ffe925a5cf67a05' (2023-06-12)
• Updated input 'utils':
'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
→ 'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31)
• Added input 'utils/systems':
'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
|
|
read_password_from_tty doesn't have a fallback if input is a pipe.
This makes scripting and integration testing harder.
Noticed while updating our nixos integration test.
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
|
|
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
|
|
snapshot tree
|
|
mode in userspace
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
so that libbcachefs.so builds in a reproducible way
in spite of non-deterministic filesystem readdir order.
See https://reproducible-builds.org/ for why this is good.
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bch2_trans_unlock()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
In an effort to rewrite `bch2_read_super` from C to Rust,
it is neccessary to have `opt_get!` macro defined, and some
FMODE_* consts (defined as macro in `include/linux/blkdev.h`)
defined as Rust const.
Bindgen is currently unable to exapnd C functional macro [1],
this this commit use the workaround as introduced in [2].
[1] https://github.com/rust-lang/rust-bindgen/issues/753
[2] https://github.com/rust-lang/rust-bindgen/issues/753#issuecomment-608546390
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
|
|
This commit enhances mount sub command by allowing it to accept
`OLD_BLKID_UUID=xxx` as the device, enabling whole fs mounting without relying
on colon-separated devices.
Using colon-separated devices in fstab is discouraged due to potential device
reference issues after reboot. Additionally, using `UUID=xxx` in fstab or with
`mount -t bcachefs` is currently infeasible as it depends on blkid, which prior
to v2.39, does not recognize bcachefs. This update enables mounting via fstab
using `OLD_BLKID_UUID=xxx` as obtained from `bcachefs show-super` "External
UUID".
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
|
|
Improve the Rust logger by adhering to idiomatic Rust conventions and
incorporating additional logging levels: warn, debug, and trace.
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
|
|
Hi
Here I'm sending a small compile fix for bcachefs-tools.
Without this patch, I get this error:
cargo build --release --manifest-path rust-src/Cargo.toml
Compiling bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)
error: failed to run custom build command for `bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)`
Caused by:
process didn't exit successfully:
`/usr/src/git/bcachefs-tools/rust-src/target/release/build/bch_bindgen-733e88995ce9eab7/build-script-build`
(exit status: 101)
--- stderr
warning: optimization flag '-fkeep-inline-functions' is not supported
[-Wignored-optimization-argument]
../../include/linux/bit_spinlock.h:20:3: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
../../include/linux/bit_spinlock.h:28:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
../../include/linux/bit_spinlock.h:39:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
The futex() function is declared in
/usr/include/x86_64-linux-gnu/urcu/futex.h
It is not declared in linux/futex.h, so we need to include urcu/futex.h
Mikulas
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
initialized in fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bch2_verify_bucket_evacuated()
|
|
For systems without working rust/llvm/bindgen, add an option for
building without Rust. This will be less of an option in the future, as
more code gets rewritten in Rust.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
These tests have never been useful; drop them.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
check_extents()
|
|
|
|
all fsck errors of given type
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
backpointers in alloc keys
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Incremental builds are fast again
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Package and publish deb+rpm for easy testing
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
missing extent message
|
|
bch2_check_extents_to_backpointers()
|
|
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
A recent libbcachefs update accidentally committed a change that dropped
the O_DIRECT flag - we definitely didn't want to do that.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Add a new make target to build an rpm. This uses rpmbuild --build-in-place,
so no SRPM is created.
Also clean up the specfile to remove manually-added Requires: that will
be auto-generated, add a couple new BuildRequires: and use macros for
file locations.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
|
|
- add some project info for the main readme
- migrate readmes to markdown for improved formatting
- The main binary now requires the Rust toolchain, so make note of it
in the build instructions.
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bch2_btree_iter_peek_node_and_restart()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Fixes building the .deb
- also add missing libudev to debian build deps
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
This implements BtreeNodeIter, and adds it to cmd_list.rs - the next
step in having a full replacement for cmd_list.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
unions
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
correct data type
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
This implements opt_set!(), which works exactly the same as the C
version and allows filesystem options to be specified in Rust code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Now we have a rust-style enum for key types
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Implement a rust equivalent to bkey_s_c, which uses references with the
correct lifetimes: now cmd_list.rs doesn't need unsafe.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
This adds a new wrapper type for btree iterator flags.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
This is a _very_ preliminary rewrite of the cmd_list tool in rust, which
is intended to be a testing ground for a safe interface in Rust to the
core btree interface. This adds rust wrappers for:
bch_fs: provides bch2_fs_open(), bch2_fs_stop
btree_trans: provides bch2_trans_init(), bch2_trans_exit()
btree_iter: provides peek, peek_and_restart, advance
bch_errcode: implements Display (wraps bch2_err_str())
bpos: implements Ord (wraps bpos_cmp())
bkey_s_c: implements Display (wraps bch2_bkey_val_to_text())
and other assorted types.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
bch2_btree_iter_peek_and_restart_outlined()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Heavily simplified to just call make with the required rust dependencies.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
|
|
formatting
Signed-off-by: Westly Ward <sonicrules1234@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
- passing of arguments from c -> rust code now works correctly
- 'bcachefs mount' now handles being passed a device or devices
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
Rust is now required for building the bcachefs tool, and rust code is
now fully integrated with the C codebase - meaning it is possible to
call back and forth.
The mount helper is now a subcommand, 'mount.bcachefs' is now a small
shell wrapper that invokes 'bcachefs mount'.
This will make it easier to start rewriting other subcommands in rust,
and eventually the whole command line interface.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
btree split race
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
cpu_relax() is supposed to be a compiler barrier - this fixes a bug with
btree_write_buffer_flush() getting stuck.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
check_bucket_ref() error
|
|
Instead of having to use grep, this adds the ability to print out only
transactions that update a particular key, or to filter out entirely
keys except those updating certain btrees.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
remount is handled by libc, not the kernel mount procedure, this fixes
remounts. Also sorted the list of flags.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
|
|
node rewrites due to errors
|
|
btree roots for all alloc btrees
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Update Cargo.lock files to match new dependancies
Bump nixpkgs pin
|
|
This fixes a ZSTD warning.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
Signed-off-by: Daniel Hill <daniel@gluo.nz>
|
|
tracing framework is a overengineered for simple mount helper. Add a
few very barebone logging macros to allow configurable verbosity and
colorized output with a small footprint.
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
follow the kernel style guide, i.e idiomatic rust style.
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
suppress errors for any non-bchfs blockdevs found during probing
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
- add support for fstab format, UUID=<uuid>
- structopt is no longer actively maintained, replace with clap v4
which support everything structopt can and more.
- update dependencies
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
Signed-off-by: Daniel Hill <daniel@gluo.nz>
|
|
Removed outdated overlay.
Simply build tooling using bingenHook and propagated*Inputs
Signed-off-by: Daniel Hill <daniel@gluo.nz>
|
|
Signed-off-by: Daniel Hill <daniel@gluo.nz>
|
|
|
|
fix misnomer and some formatting
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
|
|
This changes the default version for the format command to be the
currently supported version, via
/sys/modules/bcachefs/parameters/version.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|
|
|
|
|
|
This correctly prints out our private error codes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
- Spin up a background thread to call the shrinkers every 1 second
- Memory allocations will only call reclaim after a failed allocation,
not every single time
This will be a major performance boost on allocation intensive
workloads.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
|
|
|