Commit Graph

67 Commits

Author SHA1 Message Date
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
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
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
1e058db4b6 cmd_dump: Open in noexcl mode
no need to make it harder to dump than it needs to be

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-31 21:34:15 -04:00
Reed Riley
6c32c8d9c9 change setattr to set-file-option in docs/usage 2024-08-22 16:23:51 -05:00
Antti Savolainen
ef47274485 Change lingering set-option texts to set-fs-option 2024-08-21 15:24:00 +03:00
Kent Overstreet
31039815a7 posix_to_bcachefs: fix missing copy_xattrs() error checking
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-20 19:47:56 -04:00
Kent Overstreet
8b93af8747 kill_btree_node fixup
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-10 17:30:27 -04:00
Kent Overstreet
6687752a1d Update bcachefs sources to 070f7d6a382a bcachefs: bch2_sb_nr_devices()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-10 11:52:25 -04:00
Kent Overstreet
3f885423df fsck: modprobe before doing version check
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09 04:01:23 -04:00
Kent Overstreet
8d75a97e1a cmd_fs_usage: fix null ptr deref
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09 03:44:27 -04:00
Kent Overstreet
da1d5571f5 fixup! cmd_set_option: Can now set device options
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-06 20:34:20 -04:00
Kent Overstreet
52b9e813bd Rename option commands
set-option	-> set-fs-option
setattr 	-> set-file-option

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-20 16:45:08 -04:00
Kent Overstreet
8594891772 cmd_set_option: Can now set device options
This allows data_allowed (and others) to be set on an offline
filesystem.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-15 20:17:37 -04:00
Kent Overstreet
32fbdff2a9 Update bcachefs sources to 4a7a003763f5 bcachefs: Opt_durability can now be set via bch2_opt_set_sb() 2024-07-15 20:17:37 -04:00
Kent Overstreet
755788e2d6 Be explicit about which fsck implementation we're running
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-29 11:55:03 -04:00
Kent Overstreet
fc06a0ea5e Update bcachefs sources to c56e1ec97dfd bcachefs: Fix bch2_sb_downgrade_update()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-17 12:38:43 -04:00
Ariel Miculas
ab83e348fb Preserve directory {a,m,c} times by calling copy_times() after the recursion
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-16 14:09:18 -04:00
Ariel Miculas
3a4a096cd2 Fix incomplete file copy due to copy_data misuse
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-16 14:09:13 -04:00
Ariel Miculas
ed675b8d64 Fix performance regression of update_inode
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-16 14:08:59 -04:00
Ariel Miculas
d750b2b98b bcachefs: allow initializing a bcachefs filesystem from a source directory
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-16 14:08:52 -04:00
Kent Overstreet
e1fa076a86 Fix target option parsing for format, migrate
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-07 16:12:55 -04:00
Kent Overstreet
0916d38664 cmd_fs_usage: Use now BCH_IOCTL_QUERY_ACCOUNTING
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-03 20:08:06 -04:00
Kent Overstreet
da5435b0cc cmd_fs_usage: split out devs_usage_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03 20:08:06 -04:00
Kent Overstreet
7d79fba1af Update bcachefs sources to f81dc88f0c80 bcachefs: bch2_btree_insert() - add btree iter flags
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03 20:08:06 -04:00
Kent Overstreet
587f7f5a47 cmd_list_journal: open with noexcl, so we can work on mounted filesystems
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-02 21:06:47 -04:00
Thomas Mühlbacher
25bce91b4b refactor: rename function again
`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-30 22:26:06 +02:00
koverstreet
de6e8ac230
Merge pull request #280 from JohnRTitor/cleanup
treewide: fix typos in docs and comments
2024-05-29 23:56:27 -04:00
Kent Overstreet
3016a7dbbd cmd_fsck: Fix check for running online fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-29 18:01:59 -04:00
Andrea Gelmini
18f9526c45
treewide, docs: fix typos
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-29 09:22:09 +05:30
Kent Overstreet
80167bf0a8 cmd_dump: Dump full btree nodes
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-26 12:51:26 -04:00
Kent Overstreet
1e35104d31 Revert dump blocksize change
It appears qemu-img chokes on qcow2 images with too many l1 entries

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-25 12:51:31 -04:00
Thomas Bertschinger
7bf821f3f9 check errno to determine fsck ioctl error
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-25 00:02:27 -04:00
koverstreet
ff44b8b96d
Merge pull request #275 from intelfx/work/fix-naming
fusemount: unbreak build
2024-05-24 18:09:54 -04:00
Kent Overstreet
9cd7440649 cmd_dump: Dump btree nodes correctly
We were using sectors_written from the parent node - whoops

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-24 18:07:20 -04:00
Ivan Shapovalov
72ad5766bd fusemount: unbreak build
Commit 477670f4 ("Update bcachefs sources to 07f9a27f1969 bcachefs: add
no_invalid_checks flag") changed capitalization of BTREE_ITER_* flags.
Update cmd_fusemount.c accordingly.

Fixes: 477670f4 ("Update bcachefs sources to 07f9a27f1969 bcachefs: add no_invalid_checks flag")
2024-05-24 22:56:50 +02:00
Kent Overstreet
477670f481 Update bcachefs sources to 07f9a27f1969 bcachefs: add no_invalid_checks flag 2024-05-09 16:26:14 -04:00
Kent Overstreet
5531accc97 cmd_dump: Fix missing sectors-to-bytes conversion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-08 19:04:53 -04:00
Kent Overstreet
52904aa886 BCACHEFS_KERNEL_ONLY
Add an environment variable that indicates we prefer to run bcachefs
code in the kernel, not userspace - this is for the test environment
where it's easier to debug kernel code.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-04 15:28:24 -04:00
Evan Richter
a739671c0b add short arg parsers to device add command
Without the single char (with ':' if optarg expected) only the long
argument string would successfully parse.

For example, now "-lasdf" parses the same as "--label asdf"
2024-04-29 10:16:13 -06:00
Evan Richter
b832e3b2f7 remove --tier from device add getopt parser 2024-04-29 09:59:16 -06:00
Kent Overstreet
ec2d118738 fix splice_fd_to_stdinout() when stdin is closed
We need to check when stdin has been closed - otherwise we'll spin
because select() will return immediately.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-25 00:43:47 -04:00
Kent Overstreet
5639fb38ca Update bcachefs sources to 09d4c2acbf4c bcachefs: reconstruct_inode()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-03 17:34:02 -04:00
Kent Overstreet
9f4ed5ce05 cmd_show_super: Also print device model
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-01 21:38:19 -04:00
Kent Overstreet
6e50a9b4fc cmd_list, cmd_list_journal: pass -o very_degraded 2024-03-30 22:09:06 -04:00
Kent Overstreet
8e02744a90 Update bcachefs sources to 794723fc10c4 bcachefs: Topology repair now uses nodes found by scanning to fill holes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-30 22:05:40 -04:00
Kent Overstreet
abfdc593a5 Update bcachefs sources to 83338f5b2cb8 bcachefs: fix for building in userspace 2024-03-16 19:40:33 -04:00
Kent Overstreet
f4f87d9f76 cmd_dump: Set very_degraded
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-08 16:40:38 -05:00