Commit Graph

1492 Commits

Author SHA1 Message Date
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
Kent Overstreet
5aaa6422b6 Update bcachefs sources to ad29cf999a91 bcachefs: set_btree_iter_dontneed also clears should_be_locked
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-15 14:24:48 -04:00
Tony Asleson
825062222c mount: canonicalize device path for single device node
If we pass a symlink for a single device node we fail to locate the
device node.  Canonicalize the device node before we try to read up
the superblock.

This allows the following to work.
 # bcachefs mount /dev/mapper/vg-thinvolume /mnt/lv_thin

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-04-09 15:03:26 -05:00
Kent Overstreet
5639fb38ca Update bcachefs sources to 09d4c2acbf4c bcachefs: reconstruct_inode()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-03 17:34:02 -04:00
Kent Overstreet
9f4ed5ce05 cmd_show_super: Also print device model
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-01 21:38:19 -04:00
Kent Overstreet
6e50a9b4fc cmd_list, cmd_list_journal: pass -o very_degraded 2024-03-30 22:09:06 -04:00
Kent Overstreet
8e02744a90 Update bcachefs sources to 794723fc10c4 bcachefs: Topology repair now uses nodes found by scanning to fill holes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-30 22:05:40 -04:00
Tony Asleson
89b322abb3 mount: Handle multi-device with 1 device node
Instead of requiring the user to supply all the device nodes for a
multi-device FS, allow them to specifiy 1 of them.  We then fetch
the UUID for the FS and then find all the disks on the system that
match this UUID.

This allows me to bring up a bcachefs FS in /etc/fstab by using a
UUID.  This works because it appears the mount command looks up
the UUID, finds an entry in /dev/disk/by-uuid and then passes that
found device node to mount.bcachefs which fails with
`insufficient_devices_to_start` as bcachefs is expecting a list of
devices with a ":" between them.  This behavior is preserved if a
user specifies a list of all the needed device nodes to bring up
the FS.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-20 17:02:35 -04:00
Thomas Glanzmann
c28af3c0cc Typo: Tell sh to read the script from stdin
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-18 16:10:30 -04:00
Thomas Glanzmann
8ce35b5424 Add example to install rust toolchain and add two missing debian build dependencies.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-18 14:21:52 -04:00