Commit Graph

54 Commits

Author SHA1 Message Date
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
Kent Overstreet
62ab2e5216 Update bcachefs sources to 26494335d114 bcachefs: improve move_gap()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-25 21:34:11 -05:00
Cyan
0c00d3a372
Typo 2024-02-24 14:21:54 +08:00
Roland Vet
16661be294 bch2_sb_is_encrypted{,_and_locked}
Specifically also mention locked

Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-23 08:37:23 +01:00
Roland Vet
817e957697 Apply naming convention: passphrase->unlock->key->decrypt->fs
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-23 08:37:23 +01:00
Kent Overstreet
6ff5313cbe cmd_fsck: Collect return code of kernel fsck with close()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-17 23:31:47 -05:00
koverstreet
d1900b637e
Merge pull request #211 from oz123/master
Add option to read passphrase from a keyfile
2024-02-16 01:53:37 -05:00
Kent Overstreet
f2ba586baf fix build on old gcc
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-13 23:27:04 -05:00
Kent Overstreet
da67fc2360 fsck: Fall back to userland fsck when probed for kernel fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-13 22:05:09 -05:00
Kent Overstreet
cd4cbfc627 fsck: Automatically use kernel fsck when better version match
To avoid expensive version upgrades and downgrades - use the kernel
version of fsck when it's availale and a better match.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-12 15:52:26 -05:00
Kent Overstreet
b03f7b606f kill_btree_node: fix return code
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-10 21:16:03 -05:00
Kent Overstreet
f3f005c76e Update bcachefs sources to 50847e296b34 bcachefs: Check subvol <-> inode pointers in check_inode()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-06 01:07:16 -05:00
Kent Overstreet
da4bbf51d0 cmd_list_journal: --transaction-filter now takes range
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-27 10:58:14 -05:00
Ryan Lahfa
76538fa923 feat(c_src): drop entirely subvolume subcommands
We get rid of it as we have now a pure Rust version.

Signed-off-by: Ryan Lahfa <bcachefs@lahfa.xyz>
2024-01-27 05:46:24 +01:00