Commit Graph

85 Commits

Author SHA1 Message Date
Chris Webb
2d5118e01f bcachefs-tools: Use basename(3) from <libgen.h>
Although glibc also provides basename(3) from <string.h>, this is
non-standard whereas it is available from <libgen.h> portably.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-09 23:25:00 -05:00
Kent Overstreet
138397d892 cmd_fs_usage: Print out replica set durability
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-25 00:06:32 -05:00
Kent Overstreet
469e8eb008 Avoiding picking different bucket sizes for different devices
Erasure coding can't create stripes across devices with different bucket
sizes - therefore, format shouldn't pick different bucket sizes for
different devices.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-06 20:47:48 -05:00
Kent Overstreet
8eaf8ddf45 Update bcachefs sources to 7250b2ee5574 bcachefs: Fix deleted inodes btree in snapshot deletion 2023-10-27 16:43:11 -04:00
Kent Overstreet
2252eecec7 Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19 22:56:59 -04:00
Kent Overstreet
6a34032417 Update bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into direct assignment
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-18 22:14:53 -04:00
Hunter Shaffer
9f98746bfc Change open_for_format to the block io api
Upcoming patch will add device benchmarking at format time, which needs
the bio API.

Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
2023-10-08 21:06:07 -04:00
Hunter Shaffer
b2ffa12074 deleted unused path to device in get_size, get_blocksize
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
2023-10-08 21:06:07 -04:00
Kent Overstreet
1251ea58a8 Update bcachefs sources to 7bf1ac0d46 bcachefs: Correctly initialize new buckets on device resize
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
2023-10-08 21:06:07 -04:00
Brian Foster
f68e0ed16e libbcachefs: convert sb features mask to little endian
bch_sb.features is an array of __le64. Convert the native endian format
of the features mask appropriately. This causes a bcachefs format to
produce an unmountable fs when run from a big endian system.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-19 16:15:56 -04:00
Kent Overstreet
c8bec83e30 Update bcachefs sources to e14d7c7195 bcachefs: Compression levels
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-15 17:36:15 -04:00
Kent Overstreet
3867739e56 Update bcachefs sources to be2d60d948 bcachefs: New magic number 2022-12-02 19:48:23 -05:00
Kent Overstreet
6f5afc0c12 Update bcachefs sources to bdf6d7c135 fixup! bcachefs: Kill journal buf bloom filter 2022-05-02 18:42:06 -04:00
Kent Overstreet
e240b4ae86 Update bcachefs sources to f638850417 bcachefs: bch2_trans_log_msg() 2022-03-30 17:40:37 -04:00
Kent Overstreet
74148a8ee5 Update bcachefs sources to 0e705f5944 fixup! bcachefs: Refactor bch2_btree_node_mem_alloc() 2022-03-21 02:13:02 -04:00
Kent Overstreet
5528e3ae62 Update bcachefs sources to 9b3aa5ec6c bcachefs: Add tabstops to printbufs 2022-02-22 04:56:09 -05:00
Wessel Dankers
7b15324de1
Fix heap corruption in bcachefs format
In bch2_format(): recompute mi after each sb modification:
its location in memory may have changed due to reallocation.

This fixes an issue where labels were not assigned (because
they were written to an undefined part of the heap instead of
the superblock).

Signed-off-by: Wessel Dankers <wsl@fruit.je>
2022-01-13 00:08:52 +01:00
Kent Overstreet
9cc3b7debb Unit handling cleanups
The option code has been switching to keeping things in display units -
bytes - and this transitions more libbcachefs.c code to bytes as well,
to match, and also fixes device add.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-01-01 21:14:22 -05:00
Kent Overstreet
38f8daa2b1 Update bcachefs sources to 078a1a596a bcachefs: Optimize bucket reuse 2021-12-28 15:03:54 -05:00
Kent Overstreet
07b18011cc Update bcachefs sources to f9d2e809a8 bcachefs: Turn encoded_extent_max into a regular option 2021-12-25 18:48:46 -05:00
Kent Overstreet
ad03173172 Update bcachefs sources to aa540d47ab bcachefs: Option improvements 2021-12-25 18:48:46 -05:00
Kent Overstreet
6a4f458a48 fix init_layout()
It was incorrectly failing when we did have enough space for the
superblocks - >= should have been >.  Also, give it a better error
message.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-12-19 21:55:09 -05:00
Kent Overstreet
57f6402131 Rename group to label in show-super output
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-12-13 17:14:44 -05:00
Kent Overstreet
2fc5a50bd6 Fix device add for kernel sysfs changes
Also slightly improve some error messages

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-12-10 14:07:31 -05:00
Kent Overstreet
55e3496d06 Rename --group to --label
Disk labels used to be called groups - not all uses had been converted.
This renames --group to --label, and --label to --fs_label

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-12-10 13:32:35 -05:00
Kent Overstreet
07ec713e05 Update bcachefs sources to 1a510b00b6 bcachefs: Increase BTREE_TRANS_MEM_MAX 2021-07-04 23:33:54 -04:00
Kent Overstreet
fe1bb39aa5 Fix format args to die()
Also, add the format attribute so we get warnings about this.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-06-14 20:28:26 -04:00
Kent Overstreet
ea750088b0 Write a backup superblock at the end of the disk
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-05-27 21:12:17 -04:00
Brett Holman
9c0dc7b8d4 minor fixes for clang support 2021-05-19 23:26:13 -04:00
Kent Overstreet
8ba5e814fd Fix some small memory leaks
Found with -fsanitize=leak

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-16 17:28:40 -04:00
Kent Overstreet
08e14f84d9 Add compatible feature bits to bch2_sb_print()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-04 22:18:01 -04:00
Kent Overstreet
f46437f06e bcaachefs device set-state can now work by id 2021-04-02 23:35:05 -04:00
Kent Overstreet
bb6eccc2ec Increase default superblock size to 1MB
Also - add an option to bcachefs format for specifying it,
--superblock_size

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-03-24 22:40:25 -04:00
Kent Overstreet
1f0d52aa06 Set features in format
This is a fixup for d3dc47271b Add format options for --no-initialize
and specifying the metadata version

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-03-22 17:24:13 -04:00
Kent Overstreet
d3dc47271b Add format options for --no-initialize and specifying the metadata version
These are only to be used for tests.
2021-03-21 16:21:51 -04:00
Kent Overstreet
8a69e01aeb Add the version_min field to cmd_show_super
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-03-21 15:59:21 -04:00
Kent Overstreet
9e5d774875 Update bcachefs sources to e2b8120595 bcachefs: Use x-macros for more enums 2021-02-20 22:34:09 -05:00
jpsollie
3c7db5cec4 Add metadata_target functionality
While metadata_target was an option in bcachefs and the fs driver knows about it,
it was never parsed by the bcachefs format command.
This commit fixes the issue
2021-02-12 07:14:36 +01:00
Kent Overstreet
4064aa126e Update bcachefs sources to 26409a8f75 bcachefs: Journal updates to dev usage 2021-02-02 16:07:59 -05:00
Kent Overstreet
0e05fa6dfe Add device index to show-super 2021-01-26 20:48:58 -05:00
Kent Overstreet
4915b450e2 Improve some log messages 2020-11-13 16:45:21 -05:00
Kent Overstreet
a9a46467e6 Assorted debug and fsck improvements
This adds a new list mode to "bcachefs list", for printing out nodes as
they exist on disk (before being merge sorted). Also some improvements
to fsck return values.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-08-24 16:26:22 -04:00
Kent Overstreet
cd9892e543 Update bcachefs sources to 10ab39f2fa bcachefs: Improvements to the journal read error paths 2020-08-24 16:25:05 -04:00
Kent Overstreet
b867ddadb3 print out sequence number in show-super 2020-07-08 15:58:35 -04:00
Kent Overstreet
b87ed383d3 Flush stdout when displaying progress bar
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-04-24 19:08:39 -04:00
Kent Overstreet
50de96f5b2 show-super now lists superblock features 2019-12-28 20:31:41 -05:00
Kent Overstreet
f0d907189f Update bcachefs sources to 86a99a7b7f bcachefs: Convert some enums to x-macros 2019-12-28 20:31:39 -05:00
Kent Overstreet
c58f66878f Fix bchu_fs_get_devices() 2019-12-27 14:04:16 -05:00
Kent Overstreet
7d2baabdb1 Redo cmd_fs_usage for new ioctls 2019-12-18 16:11:11 -05:00
Kent Overstreet
b540b170c9 Update bcachefs sources to cddca21efc bcachefs: Don't use sha256 for siphash str hash key 2019-10-04 16:22:37 -04:00