summaryrefslogtreecommitdiff
path: root/c_src
AgeCommit message (Collapse)Author
2025-03-26fsck: Kill -R, --reconstruct_allocKent Overstreet
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-26bcachefs-tools: fix build failure by fixing of C header filenameIntegral
C header filename in `c_src/cmd_fusemount.c` hasn't been updated after renaming `libbcachefs/fs-common.h`. Updating the filename to fix build failure. Signed-off-by: Integral <integral@archlinuxcn.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-26migrate_superblock: make sure we remove old superblockKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-25format: fix minimum bucket nr checkKent Overstreet
2025-03-25Update bcachefs sources to 1392e502d48b bcachefs: Add an "ignore unknown" ↵Kent Overstreet
option to bch2_parse_mount_opts() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-24Migrate tool fixesKent Overstreet
Migrate now works: there is an inconsequential free space inconsistency after marking the new superblock (in migrate_superblock), which we're hacking around with a fsck. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-23format: kill min_size()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-23format: Redo bucket size calculationsKent Overstreet
bucket size now takes into account system memory and amount of memory required to fsck: on very large filesystems it will automatically scale up bucket size to ensure we can fsck. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-23bch2_format() now takes a darray of dev_optsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-19More device option workKent Overstreet
More work to regularize device options, with common command line parsing - like other options. This fixes an assortment of little nits: buggyness with the discard option, device state (and others) can now be specied at device add time, and is a decent cleanup. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-19cmd_fsck: just exit if passed -aKent Overstreet
-a is used when called from system to mean "automatic invocation, run check only if you think you need it". Since we have self healing and online fsck, we never need run fsck automatically at boot time. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-19Update bcachefs sources to dbe591cee299 bcachefs: Add missing smp_rmb()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-17cmd_recover_super: 'bcachefs recover-super'Kent Overstreet
New tool for scanning for backup superblocks, to recover when the primary superblock + sb layout have been overwritten. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-16Format now sets version_incompat_allowedKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-22fix bch2_super_write() for bs > 4096Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-06cmd_fs_usage: Handle querying old versionsKent Overstreet
Fix reading accounting from old kernel versions that had it in little endian. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-03fixup! Update bcachefs sources to 63bbe0ca4167 bcachefs: ScrubKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-03ScrubKent Overstreet
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>
2025-02-03bcachefs fs topKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-03Update bcachefs sources to 63bbe0ca4167 bcachefs: ScrubKent Overstreet
2025-01-26cmd_format: fix -l, -v optionsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-01-15Fix cmd_fs_usage for disk accounting key sort changeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-09fixup! bcachefs: cmd_set_option() can now set device options on multi device ↵Kent Overstreet
filesystems
2024-12-06bcachefs: cmd_set_option() can now set device options on multi device ↵Kent Overstreet
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-04fixup! cmd_format: fix --versionKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-12-03Merge pull request #329 from ticpu/set-passphrasekoverstreet
Fix set-passphrase on --no_passphrase FS
2024-12-03cmd_format: fix --versionKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-11-28fix online fsck optionsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-11-06bcachefs-tools: Fix TODO "Show bcachefs version"Integral
Fix TODO "Show bcachefs version" in fusemount. Signed-off-by: Integral <integral@archlinuxcn.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-27Check for a sufficiently recent libblkid before formattingGabriel de Perthuis
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-26bcachefs-tools: fix build failure when BCACHEFS_FUSE=1Integral
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-20cmd_fsck: Add -K flag (don't run kernel fsck)Kent Overstreet
This was added previously, but not added to the getopt string. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-20Update bcachefs sources to 1dbc147a6eb0 bcachefs: Add version check for ↵Kent Overstreet
bch_btree_ptr_v2.sectors_written validate Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12cmd_fsck: Create loopback device for kernel fsck when necessaryKent Overstreet
fstests generic/648 now passes Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12Avoid static linking conflicts with libblkidAlyssa Ross
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-12cmd_kill_btree_node: Can now kill multiple nodes simultaneouslyKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09cmd_list_journal: Add filtering on log msgKent Overstreet
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-04fuse: graceful shutdown when startup failsThomas Bertschinger
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-09-29Update bcachefs sources to 438696e03da7 bcachefs: rename version -> bversion ↵Kent Overstreet
for big endian builds
2024-09-07Fix set-passphrase on --no_passphrase FSMae Kasza
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-08-31cmd_dump: Open in noexcl modeKent Overstreet
no need to make it harder to dump than it needs to be Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-22change setattr to set-file-option in docs/usageReed Riley
2024-08-21Change lingering set-option texts to set-fs-optionAntti Savolainen
2024-08-20posix_to_bcachefs: fix missing copy_xattrs() error checkingKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-10kill_btree_node fixupKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-10Update bcachefs sources to 070f7d6a382a bcachefs: bch2_sb_nr_devices()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09fsck: modprobe before doing version checkKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09cmd_fs_usage: fix null ptr derefKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-06fixup! cmd_set_option: Can now set device optionsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-20Rename option commandsKent Overstreet
set-option -> set-fs-option setattr -> set-file-option Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>