Go to file
Brian Foster 83bc15eefe bcachefs-tools: fix broken libblkid superblock wipe
When playing around with comparing some fstests results on different
filesystems, I noticed that a 'bcachefs format' of a previously
btrfs-formatted device still continued to mount as btrfs. The reason
for this is that the blkid wipe invoked via open_for_format() is not
working correctly. blkid_do_wipe() depends on the "SBMAGIC[_OFFSET]"
values to do any work, and the associated superblock magic flag is
not enabled on the probe.

Set the probe flags to explicitly enable the values the bcachefs
code depends on in the probe. This includes the type, label and
superblock magic information.

There are also a couple quirks in the libblkid code that might be
worth noting. One is that the superblock enablement and flag setting
functions appear hardcoded to return zero, so we just combine the
error checks. Second, while blkid_do_wipe() can return an error, it
actually doesn't in the scenario being addressed here because it
doesn't seem to distinguish between the values being absent because
nothing was found by the probe or because the values weren't enabled
in the first place. Regardless, add an error check here in the event
the wipe does explicitly fail for some unexpected reason.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-17 15:09:27 -05:00
.github ci: skip install of recommended packages 2023-11-07 20:02:43 +01:00
ccan Update bcachefs sources to f638850417 bcachefs: bch2_trans_log_msg() 2022-03-30 17:40:37 -04:00
debian Add rust toolchain to debian build-deps 2023-03-05 05:37:08 -05:00
doc Add additional information about encryption 2023-07-10 16:03:30 -04:00
include Update bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify optimistic spinning 2023-11-12 20:57:28 -05:00
initramfs Replaced mkdir -p with install -D in make install 2019-01-13 19:31:04 -08:00
libbcachefs Update bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked() 2023-11-16 17:54:06 -05:00
linux Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enum 2023-11-02 14:39:01 -04:00
packaging fuse: Set fsname correctly 2023-08-11 18:32:23 -04:00
raid snapraid 2018-11-23 02:10:44 -05:00
rust-src Bump rust edition to 2021 2023-11-16 17:54:06 -05:00
tests Add valgrind suppressions: 2022-03-24 11:41:10 -06:00
.bcachefs_revision Update bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked() 2023-11-16 17:54:06 -05:00
.editorconfig nix: overhaul build system. 2023-01-03 16:58:55 +13:00
.gitignore .gitignore: replace travis with github-ci config 2023-07-20 22:27:56 +02:00
bcachefs.8 Add manpage for mount command 2023-03-08 21:00:51 +01:00
bcachefs.c add command to generate Rust-part CLI completions 2023-11-10 21:20:01 +08:00
build.nix nix: fix build add overlay and formatter to flake 2023-11-09 22:09:33 +01:00
cmd_assemble.c Update bcachefs sources to 0906b1fb49 bcachefs: fixes for 32 bit/big endian machines 2018-05-17 02:36:19 -04:00
cmd_attr.c Update email address 2022-05-26 15:40:08 -04:00
cmd_data.c Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str() 2023-10-19 22:56:59 -04:00
cmd_device.c Change open_for_format to the block io api 2023-10-08 21:06:07 -04:00
cmd_dump.c Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in userspace 2023-09-23 20:03:23 -04:00
cmd_format.c cmd_format: Check for device options after device arguments 2023-11-06 19:02:40 -05:00
cmd_fs.c cmd_fs_usage: Implement --help 2023-06-10 20:59:22 -04:00
cmd_fsck.c Fix 'bcachefs fsck -y' 2023-07-20 18:11:51 -04:00
cmd_fusemount.c Fix build for cmd_fusermount.c 2023-11-06 19:06:34 -05:00
cmd_key.c Update bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into direct assignment 2023-10-18 22:14:53 -04:00
cmd_kill_btree_node.c Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str() 2023-10-19 22:56:59 -04:00
cmd_list_journal.c Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str() 2023-10-19 22:56:59 -04:00
cmd_migrate.c Avoiding picking different bucket sizes for different devices 2023-11-06 20:47:48 -05:00
cmd_option.c Use bch2_err_str() instead of strerror() 2022-12-19 16:05:54 -05:00
cmd_run.c Update bcachefs sources to 0906b1fb49 bcachefs: fixes for 32 bit/big endian machines 2018-05-17 02:36:19 -04:00
cmd_subvolume.c Add more specific subcommand usage messages 2021-11-01 08:12:35 -06:00
cmd_version.c Version is now specified in the makefile 2023-11-16 15:24:22 -05:00
cmds.h delete dead code 2023-11-16 17:54:06 -05:00
config.h Redo lots of stuff 2016-03-11 21:18:42 -09:00
COPYING bcache-tools are GPL 2013-07-17 13:13:31 -07:00
crypto.c Update bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into direct assignment 2023-10-18 22:14:53 -04:00
crypto.h cmd_unlock: Add -k argument to specify keyring 2022-05-19 16:01:51 -04:00
default.nix nix: fix build add overlay and formatter to flake 2023-11-09 22:09:33 +01:00
flake.lock nix: fix build add overlay and formatter to flake 2023-11-09 22:09:33 +01:00
flake.nix nix: add devShell 2023-11-09 23:13:43 +01:00
INSTALL.md ci: set and verify MSRV 2023-08-04 20:13:38 +02:00
libbcachefs.c Avoiding picking different bucket sizes for different devices 2023-11-06 20:47:48 -05:00
libbcachefs.h Avoiding picking different bucket sizes for different devices 2023-11-06 20:47:48 -05:00
make-release-tarball.sh Create COPYING.rust-dependencies in release tarballs 2023-11-16 17:54:06 -05:00
Makefile Version is now specified in the makefile 2023-11-16 15:24:22 -05:00
Makefile.compiler Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in userspace 2023-09-23 20:03:23 -04:00
mount.bcachefs.sh Add a shell script version of mount.bcachefs 2020-08-24 23:17:17 -04:00
qcow2.c deleted unused path to device in get_size, get_blocksize 2023-10-08 21:06:07 -04:00
qcow2.h cmd_migrate 2017-03-09 09:14:11 -09:00
README.md Update docs 2023-03-07 12:46:53 -05:00
tools-util.c bcachefs-tools: fix broken libblkid superblock wipe 2023-11-17 15:09:27 -05:00
tools-util.h Change open_for_format to the block io api 2023-10-08 21:06:07 -04:00

bcachefs-tools

Userspace tools and docs for bcachefs

Bcachefs is an advanced new filesystem for Linux, with an emphasis on reliability and robustness and the complete set of features one would expect from a modern filesystem.

This repo primarily consists of the following:

  • bcachefs tool, the reason this repo exists.
  • {mkfs,mount,fsck}.bcachefs utils, which is just wrappers calling the corresponding subcommands in the main tool
  • docs in the form of man-pages and a user manual

Please refer to the main site for getting started An in-depth user manual is (also) found on the official website

Build and install

Refer to INSTALL.md

Bug reports and contributions