1956 Commits

Author SHA1 Message Date
Kent Overstreet
6d7b47685b Update bcachefs sources to f0ebca18293c bcachefs: bch2_fs_open() now takes a darray
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-28 15:31:43 -04:00
Kent Overstreet
0589d9f3c3 Update bcachefs sources to 6e73711dc355 bcachefs: Read retries are after checksum errors now REQ_FUA 2025-04-28 12:50:37 -04:00
Kent Overstreet
e00e83b84d copy_data should be static
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix Flake actions / nix-matrix (push) Waiting to run
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Blocked by required conditions
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-26 21:20:08 -04:00
Benoit Brummer
4cd851a9f7
bcachefs-principles-of-operation.tex: fix slanted quotes in verbatim
This makes the lines

$ getfattr -d -m '^bcachefs\.' filename
$ getfattr -d -m '^bcachefs_effective\.' filename

copy-pastable. Otherwise they get compiled as

$ getfattr -d -m ’^bcachefs\.’ filename
$ getfattr -d -m ’^bcachefs_effective\.’ filename

in the pdf.
2025-04-23 21:50:30 +02:00
Kent Overstreet
2d61df8787 bindgen: blacklist bch_ioctl_data_event
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
fix 32 bit build - the rust side doesn't use this type:

error: builder for '/nix/store/zpk4nnya8qmiwgylhv5q71887kqqyp4d-bcachefs-tools-i686-unknown-linux-gnu-1.25.1+3304c90.drv' failed with exit code 2;
       last 25 log lines:
       > error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
       >      --> /build/source/target/i686-unknown-linux-gnu/release/build/bch_bindgen-c913367861ffd851/out/bcachefs.rs:27492:1
       >       |
       > 27492 | pub struct bch_ioctl_data_event {
       >       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >       |
       > note: `bch_ioctl_data_progress` has a `#[repr(align)]` attribute
       >      --> /build/source/target/i686-unknown-linux-gnu/release/build/bch_bindgen-c913367861ffd851/out/bcachefs.rs:27373:1
       >       |
       > 27373 | pub struct bch_ioctl_data_progress {
       >       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       > note: `bch_ioctl_data_event` contains a field of type `bch_ioctl_data_event__bindgen_ty_1`
       >      --> /build/source/target/i686-unknown-linux-gnu/release/build/bch_bindgen-c913367861ffd851/out/bcachefs.rs:27496:9
       >       |
       > 27496 |     pub __bindgen_anon_1: bch_ioctl_data_event__bindgen_ty_1,
       >       |         ^^^^^^^^^^^^^^^^
       > note: ...which contains a field of type `bch_ioctl_data_progress`
       >      --> /build/source/target/i686-unknown-linux-gnu/release/build/bch_bindgen-c913367861ffd851/out/bcachefs.rs:27501:9
       >       |
       > 27501 |     pub p: bch_ioctl_data_progress,
       >       |         ^
       >
       > For more information about this error, try `rustc --explain E0588`.
       > error: could not compile `bch_bindgen` (lib) due to 1 previous error
       > make: *** [Makefile:185: bcachefs] Error 101
       For full logs, run 'nix log /nix/store/zpk4nnya8qmiwgylhv5q71887kqqyp4d-bcachefs-tools-i686-unknown-linux-gnu-1.25.1+3304c90.drv'.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-22 08:05:59 -04:00
Kent Overstreet
3304c90bec format_opts.no_sb_at_end
Add an option for controlling whether we create a third redundant
superblock at the end of the device.

For image files that are going to immediately be resized, we want to
skip this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-21 18:46:30 -04:00
Kent Overstreet
fee67d807b linux shim: implement BLK_OPEN_CREAT
this allows O_CREAT to be passed through, for the new image creation
tool.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-21 18:46:30 -04:00
Kent Overstreet
8fae948d60 fixup! posix_to_bcachefs: Process dirents in sorted order 2025-04-21 18:46:30 -04:00
Kent Overstreet
6a83d70ef5 Update bcachefs sources to c9d875f9be1f bcachefs: Casefold is now a regular opts.h option
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix Flake actions / nix-matrix (push) Waiting to run
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Blocked by required conditions
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-21 15:47:15 -04:00
Kent Overstreet
98f2c06d41 fd fixes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-21 14:32:50 -04:00
Kent Overstreet
8873eb1d0b Pull in unicode support from kernel
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-20 20:29:37 -04:00
Kent Overstreet
3b819fd0d7 Update bcachefs sources to 7307b739bbe5 bcachefs: Read retries are after checksum errors now REQ_FUA
Some checks failed
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-19 00:12:06 -04:00
koverstreet
d681613129
Merge pull request #376 from iav/debvers
add version change for debian package
2025-04-18 23:07:25 -05:00
Igor Velkov
5551e45735
add version change for debian package
fix wrong date format in previos deb version record

Signed-off-by: Igor Velkov <iav@iav.lv>
2025-04-19 03:34:52 +03:00
Kent Overstreet
dd2c7b9b89 format: Ensure we pick power of two bucket size
Non power of two bucket sizes are allowed - but not preferred.

We were accidentally picking bucket sizes that weren't blocksize
aligned - ouch.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
v1.25.2
2025-04-18 17:24:19 -04:00
Kent Overstreet
05c6cb61f9 bindgen: blacklist bch2_prt_vprintf
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
va_list isn't FFI-safe.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-17 12:51:03 -04:00
Kent Overstreet
0f59cc6a9e Update bcachefs sources to 65456ba56b93 bcachefs: Fix struct with flex member ABI warning 2025-04-17 12:51:03 -04:00
Kent Overstreet
28039ec698 fix cargo clippy list
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-17 12:33:34 -04:00
Kent Overstreet
642bc34abc fixup! Add support for FS_IOC_GETFSSYSFSPATH
Some checks failed
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-15 12:01:13 -04:00
Kent Overstreet
0335994507 Fix bchu_fs_open_by_dev()
- we can now correctly open by parsing sysfs, instead of falling back to
  reading the superblock and grabbing the UUID

- non-UUID filesystem names now work

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-15 11:28:47 -04:00
Kent Overstreet
ae29e3069f cmd_migrate: adjust space reserved for new fs metadata
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-15 11:21:47 -04:00
koverstreet
bb0107dce7
Merge pull request #375 from xarblu/user-rustflags
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix Flake actions / nix-matrix (push) Waiting to run
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Blocked by required conditions
Preserve RUSTFLAGS from environment
2025-04-14 14:15:55 -05:00
Xarblu
96e82871a4
Preserve RUSTFLAGS from environment
Since commit 3666da87f249b23b2c1f506e0d4157fd56c543e2
the Makefile fully replaced RUSTFLAGS which users might want
to modify e.g. to use other linkers via -Clinker=*
2025-04-14 20:20:20 +02:00
Kent Overstreet
c9ee646718 Add support for FS_IOC_GETFSSYSFSPATH
With single device mode we won't always show up in sysfs by UUID, but
the new VFS ioctl handles this nicely.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
844721635c Update bcachefs sources to 2f9361370129 bcachefs: Improve opts.degraded
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
ad3875d1d9 cmd_migrate: use correct bucket size
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
e99da4dddb xclose()
Add a helper to check for close errrors - especially bad file
descriptors, that can be a fun source of heisenbugs.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
7b35cb1e4a reshuffle device_cmds(), data_cmds()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
4f5dba7a87 cmd_format: --source, --no_initialize are incompatible
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
007d6654bc cmd_format: Don't initialize in verbose mode
Verbose is excessive here.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 10:14:23 -04:00
Kent Overstreet
bd3e0742af cmd_format: make build_fs() static
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 10:14:23 -04:00
koverstreet
de5af03b9d Merge pull request #372 from iav/set_deb_version
Add changelog record into debian package to set .deb v1.25.1
2025-04-13 10:13:49 -04:00
Kent Overstreet
3af7cf7550 Fix build with gcc 11
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 10:13:49 -04:00
Igor Velkov
32d4213924 Add changelog record into debian package to set .deb v1.25.1
Signed-off-by: Igor Velkov <iav@iav.lv>
2025-04-13 10:13:49 -04:00
Kent Overstreet
24f9bd29a6 posix_to_bcachefs: Process dirents in sorted order
This improves reproducability when producing images.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 10:03:06 -04:00
Integral
bf44ffca50 bcachefs-tools: add missing "fs top" command to manual
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix Flake actions / nix-matrix (push) Waiting to run
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Blocked by required conditions
This patch adds the missing "fs top" command to manual.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-05 09:57:08 -04:00
Kent Overstreet
4812b3e3d9 v1.25.1
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
v1.25.1
2025-04-01 13:06:59 -04:00
Thomas Mühlbacher
4a5c50774e refactor: make bch_bindgen pass clippy
Some checks failed
update-flake-lock / lockfile (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Do only what is minimally necessary for these checks to pass, I guess.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 20:29:43 -04:00
Thomas Mühlbacher
e47a5ce2bc fix(nix): allow msrv test to have warnings
It is otherwise inconvenient or maybe in other cases even impossible to
have clippy pass with both the current Rust version as well as the MSRV
Rust version. (e.g. `clippy::missing_transmute_annotations` is not yet
known to our current MSRV.)

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 20:29:39 -04:00
Kent Overstreet
3aa2a4c47c format: Ensure bcachefs module is loaded before checking version
this prevents accidentally formatting with a version unsupported by the
running kernel

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 18:40:18 -04:00
Thomas Mühlbacher
33483738c6 fix: use cargo workspace
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
update-flake-lock / lockfile (push) Waiting to run
Nix Flake actions / nix-matrix (push) Waiting to run
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Blocked by required conditions
This way bch_bindgen actually gets used by various cargo subcommands,
like clippy.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 12:54:52 -04:00
Thomas Mühlbacher
ea5bdadabd chore(nix): structure github CI nix flake checks
Makes it way easier to identify CI failures for people who try to use
github for contributions.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 12:54:46 -04:00
Integral
66c943be6c bcachefs-tools: add fs_usage & return -EINVAL when no matching subcommand
Add the missing usage function for "fs" subcommand; when no matching
subcommand exists, print the usage and return -EINVAL.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31 12:51:18 -04:00
Kent Overstreet
3d968816a4 Update bcachefs sources to 7fdc3fa3cb5f bcachefs: Log original key being moved in data updates 2025-03-30 18:27:52 -04:00
Kent Overstreet
76b3ec9d66 list_journal: fix transaction filter extent matching
Giving a single pos for the transaction filter now correctly matches
against extents.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-30 18:27:52 -04:00
Kent Overstreet
3e2d5b2b9a Update bcachefs sources to 0a2abe7ce837 bcachefs: Don't use designated initializers for disk_accounting_pos
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix-Tests / nix-flake-check (push) Waiting to run
update-flake-lock / lockfile (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-29 21:50:53 -04:00
Kent Overstreet
7c47145f6c cmd_fs_usage: Fix kernel version check
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
Nix-Tests / nix-flake-check (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
This needed an access() check, like the other uses, instead of exiting
if it can't be read.

Factor out a small common helper for this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-28 11:38:55 -04:00
Integral
396545c2ea bcachefs-tools: hide FUSE in usage when BCACHEFS_FUSE disabled
When BCACHEFS_FUSE is disabled or not defined, FUSE section shouldn't
be displayed in bcachefs usage (--help).

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-28 11:12:32 -04:00
Integral
3bfe433d22 bcachefs-tools: make targets of subvolume create/delete required
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix-Tests / nix-flake-check (push) Waiting to run
Currently, when no targets are provided for "bcachefs subvolume create" or
"bcachefs subvolume delete", it will exit silently with code 0. Make targets
(arguments) required to solve this problem.

This patch solves issue https://github.com/koverstreet/bcachefs/issues/766.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-27 13:58:21 -04:00
Kent Overstreet
19d3a1778c fsck: Kill -R, --reconstruct_alloc
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix-Tests / nix-flake-check (push) Waiting to run
We don't want users hitting this accidentally, and if needed for some
strange reason (it shouldn't be), it can still be specified via -o.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-26 10:15:26 -04:00