Commit Graph

1401 Commits

Author SHA1 Message Date
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
Thomas Mühlbacher
0fcdd67bf0 build(nix): rm nixpkgs overlay
it shouldn't really be our job to define an overlay. it doesn't do
anything for us, afaict, and is trivial to implement for downstream
users of the flake if they so desire.

also the overlay doesn't even overlay anything, there is no package
called `bcachefs` in nixpkgs.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
5e9d1953a2 build(nix): simplify devShell
much more DRY.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
eccefb381d style(nix): group together inputs attr
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
b91647aab8 style(nix): run nix fmt
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
e94c985640 build(nix): switch to new RFC style nixfmt
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
04a31f10e0 build(flake.lock): update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/fa804edfb7869c9fb230e174182a8a1a7e512c40' (2023-11-02)
  → 'github:nixos/nixpkgs/3eaeaeb6b1e08a016380c279f8846e0bd8808916' (2024-05-21)
• Updated input 'utils':
    'github:numtide/flake-utils/ff7b65b44d01cf9ba6a71320833626af21126384' (2023-09-12)
  → 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
683710c068 chore(editorconfig): flesh out definitions
so it actually works.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
3882d1b1e4 refactor: manually fix remaining clippy lints
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:33:40 +02:00
Thomas Mühlbacher
3488d4f15f refactor: cargo clippy --fix
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:33:40 +02:00
Thomas Bertschinger
3ac510f6a4 add "bkey-type" option to list command
Only bkeys of the specified type will be printed.

Also, this reworks the error type in bch_bindgen to be able to
represent other kinds of error than just "invalid btree id".

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09 17:29:08 -04:00
Kent Overstreet
477670f481 Update bcachefs sources to 07f9a27f1969 bcachefs: add no_invalid_checks flag 2024-05-09 16:26:14 -04:00
Kent Overstreet
5531accc97 cmd_dump: Fix missing sectors-to-bytes conversion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-08 19:04:53 -04:00
Tony Asleson
128b569155 mount: Make udev_bcachefs_info more idiomatic
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-05-07 12:20:49 -05:00
Tony Asleson
3d63b901c6 Handle mount with FS with 1 device
If the user passes a single device node during the mount and
we have no information for it in the udev db, we read up the
super block.  When we do this, if the FS only has 1 block device
we will simply go ahead and do the mount instead of walking
all the block devices and reading up super blocks looking for
devices with a matching FS UUID.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-05-07 12:20:49 -05:00
Tony Asleson
761ef99f91 Add env. variable BCACHEFS_BLOCK_SCAN
Introduce an env. variable for users that have a broken blkid which
renders the udev db as incomplete.  Only checks for the existence
of the variable, not its value.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-05-07 12:20:49 -05:00
Tony Asleson
1fb1898b24 mount: Leverage udev db
If the udev database contains information about bcachefs, utilize it.
Otherwise, resort to traversing block devices and checking for
bcachefs super blocks.

V2: Reduce number of places we call read_super_slient in interators

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-05-07 12:20:49 -05:00
Kent Overstreet
52904aa886 BCACHEFS_KERNEL_ONLY
Add an environment variable that indicates we prefer to run bcachefs
code in the kernel, not userspace - this is for the test environment
where it's easier to debug kernel code.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-04 15:28:24 -04:00
Thomas Bertschinger
2b8a0f0caf remove redundant "cmd_" prefix from functions in "commands"
It is more idiomatic to use `commands::mount` than
`commands::cmd_mount`.

No functionality changes intended by this patch.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-30 21:16:09 -04:00
koverstreet
578f32a96e
Merge pull request #259 from evanrichter/fix_device_add_args
Fix device add args
2024-04-29 12:57:27 -04:00
Evan Richter
a739671c0b add short arg parsers to device add command
Without the single char (with ':' if optarg expected) only the long
argument string would successfully parse.

For example, now "-lasdf" parses the same as "--label asdf"
2024-04-29 10:16:13 -06:00
Evan Richter
b832e3b2f7 remove --tier from device add getopt parser 2024-04-29 09:59:16 -06:00
Kent Overstreet
efbe47e2b4 Update bcachefs sources to c19cbaf6e7b0 bcachefs: Run upgrade/downgrade even in -o nochanges mode 2024-04-28 21:29:50 -04:00
Kent Overstreet
b9e48edba7 Update bcachefs sources to 035773e55b52 bcachefs: fix integer conversion bug 2024-04-25 16:25:29 -04:00
Kent Overstreet
ec2d118738 fix splice_fd_to_stdinout() when stdin is closed
We need to check when stdin has been closed - otherwise we'll spin
because select() will return immediately.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-25 00:43:47 -04:00
Kent Overstreet
b3677f3040 Merge branch 'man-bcachefs-subvolume-snapshot' of https://github.com/FedericoSchonborn/bcachefs-tools 2024-04-19 21:42:12 -04:00
Federico Damián Schonborn
b8b36900f8
bcachefs.8: subvolume delete -> subvolume snapshot
Signed-off-by: Federico Damián Schonborn <federicoschonborn@disroot.org>
2024-04-19 22:36:17 -03:00
Kent Overstreet
0e0aa31912 Update bcachefs sources to 0389c09b2fb7 bcachefs: Fix bio alloc in check_extent_checksum()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-17 17:34:56 -04:00
Kent Overstreet
59e04ddf40 1.7.0 - mi_btree_bitmap
New on disk forat feature - per member 64 bit bitmap of regions with
btree nodes, to accelerate recovering by scanning for btree nodes.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-17 03:25:28 -04:00
Kent Overstreet
c824bbe69d Update bcachefs sources to 10ca1f99f8c9 bcachefs: Fix bch2_dev_btree_bitmap_marked_sectors() shift
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-17 01:44:20 -04:00
koverstreet
cf44deafe6
Merge pull request #251 from tasleson/handle_dev_symlink
mount: canonicalize device path for single device node
2024-04-15 18:25:41 -04:00