summaryrefslogtreecommitdiff
path: root/c_src
AgeCommit message (Collapse)Author
2025-04-15fixup! Add support for FS_IOC_GETFSSYSFSPATHKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-15Fix bchu_fs_open_by_dev()Kent Overstreet
- 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-15cmd_migrate: adjust space reserved for new fs metadataKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13Add support for FS_IOC_GETFSSYSFSPATHKent Overstreet
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-13Update bcachefs sources to 2f9361370129 bcachefs: Improve opts.degradedKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13cmd_migrate: use correct bucket sizeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13xclose()Kent Overstreet
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-13reshuffle device_cmds(), data_cmds()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13cmd_format: --source, --no_initialize are incompatibleKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13cmd_format: Don't initialize in verbose modeKent Overstreet
Verbose is excessive here. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13cmd_format: make build_fs() staticKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13posix_to_bcachefs: Process dirents in sorted orderKent Overstreet
This improves reproducability when producing images. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31format: Ensure bcachefs module is loaded before checking versionKent Overstreet
this prevents accidentally formatting with a version unsupported by the running kernel Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-31bcachefs-tools: add fs_usage & return -EINVAL when no matching subcommandIntegral
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-30list_journal: fix transaction filter extent matchingKent Overstreet
Giving a single pos for the transaction filter now correctly matches against extents. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-28cmd_fs_usage: Fix kernel version checkKent Overstreet
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-28bcachefs-tools: hide FUSE in usage when BCACHEFS_FUSE disabledIntegral
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-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>