Thomas Mühlbacher
0ca3233518
refactor: change some fn type sigs and simplify
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 12:48:42 +02:00
Thomas Mühlbacher
20f7954cdb
refactor: treat harmless clippy::pedantic
lints
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 12:48:42 +02:00
Thomas Mühlbacher
9ec185437d
fix: evaluate KeyHandle Result
...
This one is sort of bad to have missed, ouch.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 03:56:53 +02:00
koverstreet
96843fc95d
Merge pull request #283 from tmuehlbacher/msrv-and-tweaks
...
Msrv and tweaks
2024-05-30 20:41:29 -04:00
Thomas Mühlbacher
781ea5d40f
fix: minor tweaks for key.rs
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 02:30:59 +02:00
Thomas Mühlbacher
31066e17e8
fix: keep compat with MSRV
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 02:30:59 +02:00
koverstreet
d42a097280
Merge pull request #281 from tmuehlbacher/rewrite-rust-key-handling
...
Rewrite rust key handling
2024-05-30 19:56:27 -04:00
Thomas Mühlbacher
22495e0d31
feat: rewrite key.rs
...
- Introduce `KeyHandle` and `Passphrase` types
- Refactor the functions into associated functions
- Add `zeroizing` crate to handle passphrase memory safely
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-30 22:26:06 +02:00
Thomas Mühlbacher
25bce91b4b
refactor: rename function again
...
`bch2_sb_is_encrypted_and_locked()` simply does not check if the fs is
locked. The name is misleading.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-30 22:26:06 +02:00
Thomas Mühlbacher
21b1111b59
refactor: reduce UnlockPolicy
boilerplate
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-30 22:26:06 +02:00
koverstreet
de6e8ac230
Merge pull request #280 from JohnRTitor/cleanup
...
treewide: fix typos in docs and comments
2024-05-29 23:56:27 -04:00
Kent Overstreet
3016a7dbbd
cmd_fsck: Fix check for running online fsck
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-29 18:01:59 -04:00
Kent Overstreet
c3c7dacab2
mount: minor cleanup
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-29 17:00:50 -04:00
Andrea Gelmini
18f9526c45
treewide, docs: fix typos
...
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
[remove changes to libbcachefs/, linux/, include/, and raid/]
Co-authored-by: Masum Reza <masumrezarock100@gmail.com>
Signed-off-by: Masum Reza <masumrezarock100@gmail.com>
2024-05-29 09:22:09 +05:30
Kent Overstreet
0c39011ae0
Update bcachefs sources to 8528bde1b66b bcachefs: Fix uninitialized var warning
2024-05-28 18:22:45 -04:00
koverstreet
cd94eda1d8
Merge pull request #279 from JohnRTitor/workflows
...
workflows: add monthly flake lock update workflow
2024-05-28 16:18:34 -04:00
John Titor
a0bbe712c0
workflows: add monthly flake lock update workflow
...
Signed-off-by: Masum Reza <masumrezarock100@gmail.com>
2024-05-29 01:12:56 +05:30
koverstreet
c36b96d4dc
Merge pull request #278 from tmuehlbacher/add-more-flake-checks
...
Add more flake checks
2024-05-28 15:25:29 -04:00
Thomas Mühlbacher
d43fbfd642
docs: rm outdated msrv in install instructions
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
7f15685517
build(nix): minor tweaks
...
- rm unused function argument
- `LIBCLANG_PATH` is superfluous here, this is already handled by
`rustPlatform.bindgenHook` for us.
- rustc is not directly needed in the `$PATH` for the build but it's
good to have in the dev shell.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
b362f12add
build(nix): add cargo test
check
...
this is pretty much a no-op currently, but hopefully we can make some
use of it in the future.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
422ae1f1a7
build(nix): add cargo clippy check
...
note that this only checks the top-level package, `bch_bindgen` is
excluded because it has too many clippy lints.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
bf2c0c8852
build(nix): use crane to build packages
...
this enables faster incremental rebuilds in nix. it also allows us to
add clippy and cargo test checks more easily. aside from that, i have
tried to carry over things that i think are sensible from the previous
`mkDerivation` call.
the `checkPhase` may as well rather be done in a `installCheckPhase` and
we can set `enableParallelBuilding` to speed up the compilation of
`libbcachefs.a`.
2024-05-28 19:32:15 +02:00
Thomas Mühlbacher
ce01c61ba5
build(nix): enable rustfmt check+formatter
...
with this, the gh actions ci will fail if submitted code does not adhere
to rustfmt rules.
additionally, running `nix fmt` will also format rust code.
because we want rules only supported by nightly rustfmt, and nixpkgs
doesn't have a nightly toolchain, we need to pull in another flake
input: fenix.
2024-05-27 19:30:26 -04:00
Thomas Mühlbacher
0e414b462f
style: fix one straggler not caught by rustfmt
...
not sure why this wasn't picked up, maybe different versions of nightly
rustfmt?
2024-05-27 19:30:26 -04:00
Kent Overstreet
7efaf45d78
Update bcachefs sources to bc0fa834a738 bcachefs: Better fsck error message for key version
2024-05-27 19:17:49 -04:00
Kent Overstreet
067e072465
Update bcachefs sources to ea473c4a1a21 bcachefs: btree_gc can now handle unknown btrees
2024-05-27 19:04:42 -04:00
Kent Overstreet
9bb2977a1a
Update bcachefs sources to 45845c32a41a fs: bcachefs: add missing MODULE_DESCRIPTION()
2024-05-27 17:59:22 -04:00
Christopher Fore
5a3011c48e
doc: update subvolume destroy command to subvolume delete
...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-26 21:36:01 -04:00
Kent Overstreet
aa985e6a44
Format with rustfmt
...
Note that we're using struct/enum align options, which require nightly.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-26 20:38:08 -04:00
Thomas Mühlbacher
5b216318b8
check_for_key
before ask_for_passphrase
...
let's always first check if there is already a key in the keyring
available before we try to get the key from some more involved means.
Fixes : #261
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-26 13:32:56 -04:00
Thomas Mühlbacher
6ba303e8bf
fix unfortunate typo
...
causes mounting encrypted devices to become stuck in a busy loop.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-26 12:52:37 -04:00
Kent Overstreet
80167bf0a8
cmd_dump: Dump full btree nodes
...
We're still having issues with corrupted dumps when we try to dump only
the live part of btree nodes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-26 12:51:26 -04:00
Kent Overstreet
1e35104d31
Revert dump blocksize change
...
It appears qemu-img chokes on qcow2 images with too many l1 entries
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-25 12:51:31 -04:00
Thomas Bertschinger
7bf821f3f9
check errno to determine fsck ioctl error
...
The error code is in errno, not the return value.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-25 00:02:27 -04:00
koverstreet
ff44b8b96d
Merge pull request #275 from intelfx/work/fix-naming
...
fusemount: unbreak build
2024-05-24 18:09:54 -04:00
Kent Overstreet
9cd7440649
cmd_dump: Dump btree nodes correctly
...
We were using sectors_written from the parent node - whoops
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-24 18:07:20 -04:00
Kent Overstreet
3f531df2b3
Update bcachefs sources to 254510a1c269 bcachefs: btree_ptr_sectors_written() now takes bkey_s_c
2024-05-24 18:07:20 -04:00
Ivan Shapovalov
72ad5766bd
fusemount: unbreak build
...
Commit 477670f4
("Update bcachefs sources to 07f9a27f1969 bcachefs: add
no_invalid_checks flag") changed capitalization of BTREE_ITER_* flags.
Update cmd_fusemount.c accordingly.
Fixes: 477670f4
("Update bcachefs sources to 07f9a27f1969 bcachefs: add no_invalid_checks flag")
2024-05-24 22:56:50 +02:00
koverstreet
cd198e2b8e
Merge pull request #274 from tmuehlbacher/make-nix-ci-useful
...
Make nix ci useful
2024-05-24 12:01:21 -04:00
Thomas Mühlbacher
88aa61eb95
ci: run nix build in workflow
...
so since up until the last merged changes, this entire gh action pretty
much equated to a no-op, afaict. and even now, the only thing i added in
PR #272 is a formatter check only for *.nix files.
i plan to add more checks soon that will be run by `nix flake check`.
but as of right now, adding this is the quickest way to make sure at
least something useful is done by this workflow.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-23 21:04:41 +02:00
Thomas Mühlbacher
45c8cc32a3
ci: fix NixOS misnomer
...
this workflow has nothing to do with NixOS, it's just running Nix on
Ubuntu.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-23 21:03:00 +02:00
koverstreet
0f5c8e0407
Merge pull request #273 from tmuehlbacher/gh-action-fix
...
github action fix
2024-05-22 17:42:59 -04:00
Thomas Mühlbacher
368cdb8796
ci: fix ci by updating gh actions
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 23:20:16 +02:00
Thomas Mühlbacher
f40361c34f
chore(editorconfig): add *.y{,a}ml
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 23:20:16 +02:00
koverstreet
764031a4aa
Merge pull request #272 from tmuehlbacher/flake-overhaul
...
Flake overhaul
2024-05-22 16:58:18 -04:00
koverstreet
7d795ddb25
Merge pull request #271 from tmuehlbacher/cargo-clippy
...
Fix clippy lints
2024-05-22 16:44:35 -04:00
Thomas Mühlbacher
56a9580aeb
build(nix): add some packages to the dev shell
...
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
2e316499df
build(nix): add treefmt-nix
...
currently still bare but can be extended with a number of different
formatters (rustfmt, clang-format, ...). For full list see
https://flake.parts/options/treefmt-nix
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
cc16402e4f
build(nix): replace flake-utils with flake-parts
...
it also provides a way for abstracting `system` and provides optional
modules, like treefmt-nix.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00