summaryrefslogtreecommitdiff
path: root/c_src
AgeCommit message (Collapse)Author
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>
2024-07-15cmd_set_option: Can now set device optionsKent Overstreet
This allows data_allowed (and others) to be set on an offline filesystem. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-15Update bcachefs sources to 4a7a003763f5 bcachefs: Opt_durability can now be ↵Kent Overstreet
set via bch2_opt_set_sb()
2024-06-29Be explicit about which fsck implementation we're runningKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-17Update bcachefs sources to c56e1ec97dfd bcachefs: Fix bch2_sb_downgrade_update()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16Preserve directory {a,m,c} times by calling copy_times() after the recursionAriel Miculas
Otherwise the directory {a,m,c} times will be modified by the recursive copy of the directory tree. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16Fix incomplete file copy due to copy_data misuseAriel Miculas
The copy_data function takes a start and an end parameter as the range of bytes to copy, but it was called with a start and a length parameter. This resulted in incomplete file copies. Fix it by passing the end of the range instead of the length. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16Fix performance regression of update_inodeAriel Miculas
This kernel commit: 65bd442397274347e721a89c2c4882a392bae982 removes BTREE_ITER_cached from bch2_btree_insert_trans, which causes the update_inode function to take a long time (~20s). Add this flag back in the update_inode function. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16bcachefs: allow initializing a bcachefs filesystem from a source directoryAriel Miculas
Add a new source command line argument which specifies the directory tree that will be copied onto the newly formatted bcachefs filesystem. This commit also fixes an issue in copy_link where uninitialized data is copied into the symlink because of a round_up of the buffer size. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-07Fix target option parsing for format, migrateKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03cmd_fs_usage: Use now BCH_IOCTL_QUERY_ACCOUNTINGKent Overstreet
We can now report on compression type/ratio, btree usage, and pending rebalance work. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03cmd_fs_usage: split out devs_usage_to_text()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03Update bcachefs sources to f81dc88f0c80 bcachefs: bch2_btree_insert() - add ↵Kent Overstreet
btree iter flags Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-02cmd_list_journal: open with noexcl, so we can work on mounted filesystemsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-30refactor: rename function againThomas Mühlbacher
`bch2_sb_is_encrypted_and_locked()` simply does not check if the fs is locked. The name is misleading. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-29Merge pull request #280 from JohnRTitor/cleanupkoverstreet
treewide: fix typos in docs and comments
2024-05-29cmd_fsck: Fix check for running online fsckKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-29treewide, docs: fix typosAndrea Gelmini
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> [remove changes to libbcachefs/, linux/, include/, and raid/] Co-authored-by: Masum Reza <masumrezarock100@gmail.com> Signed-off-by: Masum Reza <masumrezarock100@gmail.com>
2024-05-26cmd_dump: Dump full btree nodesKent Overstreet
We're still having issues with corrupted dumps when we try to dump only the live part of btree nodes. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-25Revert dump blocksize changeKent Overstreet
It appears qemu-img chokes on qcow2 images with too many l1 entries Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-25check errno to determine fsck ioctl errorThomas Bertschinger
The error code is in errno, not the return value. Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-24Merge pull request #275 from intelfx/work/fix-namingkoverstreet
fusemount: unbreak build