Commit Graph

1611 Commits

Author SHA1 Message Date
Kent Overstreet
db3121cbf9 Fix cmd_fs_usage for disk accounting key sort change
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-Tests / nix-flake-check (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-01-05 20:08:37 -05:00
Kent Overstreet
d2bcf425d1 update min_heap
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-Tests / nix-flake-check (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-31 11:33:54 -05:00
Kent Overstreet
43a1380575 Scrub
Implement 'bcachefs data scrub', frontend for
BCH_IOCTL_DATA.BCH_DATA_OP_scrub.

Takes a path to a device, mountpoint, or filesystem uuid. Can be run on
a specific device by passing a device, or if run on a filesystem scrubs
all devices in parallel.

Metadata only scrubbing is supported via -m.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-30 21:56:48 -05:00
Kent Overstreet
6f1429b4eb Update bcachefs sources to f4b9a91fce73 bcachefs: Scrub 2024-12-30 17:04:00 -05:00
koverstreet
7210d5c911
Merge pull request #345 from Flowdalic/mount-print-error
mount: print a helpful error message
2024-12-29 16:16:25 -05:00
Kent Overstreet
1055935ffe Update bcachefs sources to 864591728963 bcachefs: Dropped superblock write is no longer a fatal error
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-29 14:57:48 -05:00
Integral
634c812a1e Fix build failure on liburcu v0.15.0
After upgrading liburcu to v0.15.0, bcachefs-tools failed to build. This patch
fixes build errors on liburcu v0.15.0.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-29 08:44:50 -05:00
Kent Overstreet
601deb6e5d fix c11 atomics
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-10 16:16:05 -05:00
Kent Overstreet
ef25411bdc fixup! bcachefs: cmd_set_option() can now set device options on multi device filesystems 2024-12-09 03:55:16 -05:00
Kent Overstreet
8b31dfb350 Update bcachefs sources to 55a65a994ed5 bcachefs: bcachefs_metadata_version_persistent_inode_cursors
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-08 16:00:44 -05:00
Kent Overstreet
2aeeac7785 bcachefs: cmd_set_option() can now set device options on multi device filesystems
Currently, 'bcachefs set-fs-option' requires all devices to be specified
when setting options on an offline multidevice filesystem - it can't yet
scan for the rest of the filesystem members.

We do need to fix this, but the scan code is written in Rust, so that
either means a lot of ugly FFI code or rewriting cmd_set_option() in
Rust - neither of which are happening today.

So as an interim hack, add a --dev-idx option: this can be specified
(multiple times if desired) for indicating which devices the device
specific options should be applied to.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-06 16:30:19 -05:00
Kent Overstreet
83cc57700f fixup! cmd_format: fix --version
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-04 21:22:03 -05:00
Kent Overstreet
626b1945eb fix build
haven't merged inode_alloc_cursor yet

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-03 23:07:00 -05:00
koverstreet
077677e61c
Merge pull request #329 from ticpu/set-passphrase
Fix set-passphrase on --no_passphrase FS
2024-12-03 22:41:13 -05:00
koverstreet
a17e2ca95c
Merge pull request #350 from michaeladler/fix/man-page-set-file-option
man: setattr has been renamed to set-file-option
2024-12-03 22:38:14 -05:00
Kent Overstreet
ac124c8885 Update bcachefs sources to 4a32728376a8 bcachefs: bcachefs_metadata_version_inode_depth
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-03 21:51:54 -05:00
Kent Overstreet
c560ff06f4 cmd_format: fix --version
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-03 21:51:26 -05:00
koverstreet
51ebefdd6e
Merge pull request #353 from nnathan/improvements_to_initcpio
initcpio: small improvements to the mkinitcpio hooks
2024-12-01 19:26:50 -05:00
Naveen Nathan
77d72319a4 initcpio: small improvements to the mkinitcpio hooks 2024-12-02 09:46:38 +11:00
koverstreet
c2af793c8c
Merge pull request #8 from DerVerruckteFuchs/master
add mkinitcpio hook for Arch and sample /etc/mkinitcpio.conf
2024-12-01 17:31:55 -05:00
Kent Overstreet
de51418b60 Update bcachefs sources to bc01863fb6ef bcachefs: bcachefs_metadata_version_disk_accounting_big_endian
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-11-29 21:27:09 -05:00
Kent Overstreet
6829fb2010 fix online fsck options
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-11-28 23:43:06 -05:00
Integral
d4932bf0e3 bcachefs-tools: Fix TODO "Show bcachefs version"
Fix TODO "Show bcachefs version" in fusemount.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-11-06 16:21:02 -05:00
Michael Adler
9beb9fabb2 man: setattr has been renamed to set-file-option
Closes #343

Fixes: 52b9e813 ("Rename option commands")
Signed-off-by: Michael Adler <michael.adler@siemens.com>
2024-11-05 14:00:13 +01:00
Integral
511a714ed3 bcachefs-tools: update VERSION in Makefile to 1.13.0
Update VERSION in Makefile to 1.13.0.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-27 16:15:00 -04:00
Integral
b7831af74d bcachefs-tools: fix in fuse feature in RUSTFLAGS
Currently, when "BCACHEFS_FUSE=1" is set, fusemount subcommand
still cannot be identified. Change RUSTFLAGS in Makefile to fix
this problem.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-27 16:15:00 -04:00
koverstreet
64767d6443
Merge pull request #347 from g2p/format-safety
Check for a sufficiently recent libblkid before formatting
2024-10-27 16:13:55 -04:00
Gabriel de Perthuis
8d5f44d3b1 Check for a sufficiently recent libblkid before formatting
This can prevent data loss as libblkid < 2.40.1 can fail
to recognize existing bcachefs filesystems.

Reported on #bcache.

Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
2024-10-27 14:48:05 +00:00
Integral
5350fd2b7b bcachefs-tools: fix build failure when BCACHEFS_FUSE=1
Currently, when BCACHEFS_FUSE=1 is set, bcachefs-tools failed to build.
Replace "bch2_trans_do()" macro with "bch2_trans_commit_do()" in
cmd_fusemount.c to fix build failure.

Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-26 01:48:17 -04:00
Malte Schröder
cb8dc1b2ba Allow multiple targets for subvolume delete.
Signed-off-by: Malte Schröder <malte.schroeder@tnxip.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-25 15:07:49 -04:00
Florian Schmaus
9ed0f3fd72 mount: print a helpful error message
Just returning a failure exit status makes it hard to tell what the
actual issue was. Instead, the mount command now also provides some
textual output.

See https://github.com/koverstreet/bcachefs-tools/issues/308 for an
example where mount does not provide any helpful output, even with
BCACHEFS_LOG=trace enabled.

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2024-10-25 10:46:26 +02:00
Kent Overstreet
2541755981 cmd_fsck: Add -K flag (don't run kernel fsck)
This was added previously, but not added to the getopt string.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-20 19:23:21 -04:00
Kent Overstreet
553d6f107a Update bcachefs sources to 1dbc147a6eb0 bcachefs: Add version check for bch_btree_ptr_v2.sectors_written validate
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-20 19:07:51 -04:00
Kent Overstreet
4f9293b045 cmd_fsck: Create loopback device for kernel fsck when necessary
fstests generic/648 now passes

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
282331defa Fix some warnings about elided lifetimes
these popped up on the latest rustc

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
b1e6d1ced2 cmd_mount: Change error message on -EBUSY to match util-linux
This causes xfstests generic/741 to pass

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Alyssa Ross
3666da87f2 Pass -C default-linker-libraries to rustc
By default, rustc passes -nodefaultlibs to the linker.  In some cases,
this can cause compiler builtins (e.g. __cpu_model, used by
__builtin_cpu_supports) not to be linked in:

= note: /nix/store/s2cjhni3s6shh0n35ay1hpj8d85k44qk-x86_64-unknown-linux-musl-binutils-2.43.1/bin/x86_64-unknown-linux-musl-ld: ./libbcachefs.a(tools-util.o): in function `resolve_crc32c':
        /build/source/c_src/tools-util.c:457:(.text+0x1023): undefined reference to `__cpu_model'
        collect2: error: ld returned 1 exit status

I saw this with static musl GCC builds, and others have reported it with
Clang.

Link: https://github.com/koverstreet/bcachefs-tools/issues/300
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Alyssa Ross
6153c37e38 Avoid static linking conflicts with libblkid
When static linking, it's not possible to have two functions with the
same name in different libraries:

	= note: /nix/store/s2cjhni3s6shh0n35ay1hpj8d85k44qk-x86_64-unknown-linux-musl-binutils-2.43.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/zwid05lzfy46k32xljb2alh0gq7ys58a-util-linux-minimal-static-x86_64-unknown-linux-musl-2.39.4-lib/lib/libblkid.a(libcommon_la-crc32c.o): in function `crc32c':
	        (.text+0x0): multiple definition of `crc32c'; ./libbcachefs.a(tools-util.o):/build/source/c_src/tools-util.c:484: first defined here
	        collect2: error: ld returned 1 exit status

Work around this by avoiding a known name collision with a function in
libblkid.

Closes: https://github.com/koverstreet/bcachefs-tools/issues/311
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
4e25d26a81 Update bcachefs sources to 9ab6c94002b9 bcachefs: bch2_journal_meta() takes ref on c->writes 2024-10-12 17:20:56 -04:00
Kent Overstreet
1dba682527 cmd_kill_btree_node: Can now kill multiple nodes simultaneously
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
571ca8b8ce cmd_list_journal: Add filtering on log msg
This allows us to filter out e.g. all btree_node_write_work transacitons

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09 21:58:15 -04:00
Kent Overstreet
01413354a5 Update bcachefs sources to 8aa83b2beeb3 bcachefs: Improve check_snapshot_exists() 2024-10-09 21:58:03 -04:00
Kent Overstreet
1d68a6da59 Update bcachefs sources to 3b80552e7057 bcachefs: __wait_for_freeing_inode: Switch to wait_bit_queue_entry
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09 19:49:17 -04:00
Kent Overstreet
c4456b4714 Update cargo dependencies
This fixes an odd bindgen issue

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09 19:48:37 -04:00
Kent Overstreet
d27d4cf7f0 Fix 'fuse' feature conditional compilation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-05 22:49:27 -04:00
Thomas Bertschinger
3829e49167 fuse: graceful shutdown when startup fails
When FUSE startup encounters an error after opening the filesystem--for
example because of a bad mountpoint--it exited uncleanly, which is a
bit unfriendly.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-04 22:48:21 -04:00
Kent Overstreet
9f20109509 Update bcachefs sources to 438696e03da7 bcachefs: rename version -> bversion for big endian builds 2024-09-29 22:18:18 -04:00
Kent Overstreet
7a98f526b5 cmd_list: open with noxcl
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-29 22:18:18 -04:00
Kent Overstreet
bc5d903fda Update bcachefs sources to 82792a451950 bcachefs: Switch some bch2_dev_rcu() calls to _noerror
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-07 22:25:45 -04:00
Mae Kasza
45468a9a6f
Fix set-passphrase on --no_passphrase FS
This also fixes a bug where the set-passphrase
command failed to derive the key for disks initially
formatted with --encrypted and --no_passphrase, due to
bch_sb_crypt_init not configuring the KDF params if
the passphrase wasn't specified during formatting.

Signed-off-by: Mae Kasza <git@badat.dev>
Tested-by: Jérôme Poulin <jeromepoulin@gmail.com>
2024-09-07 21:46:32 -04:00