From 1251ea58a84e365db3754e6f5f57bd442484dc89 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 7 Oct 2023 17:23:13 -0400 Subject: Update bcachefs sources to 7bf1ac0d46 bcachefs: Correctly initialize new buckets on device resize Signed-off-by: Hunter Shaffer --- cmd_format.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cmd_format.c') diff --git a/cmd_format.c b/cmd_format.c index 26a1cd9f..4b1dcbe2 100644 --- a/cmd_format.c +++ b/cmd_format.c @@ -245,7 +245,7 @@ int cmd_format(int argc, char *argv[]) buf.human_readable_units = true; - bch2_sb_to_text(&buf, sb, false, 1 << BCH_SB_FIELD_members); + bch2_sb_to_text(&buf, sb, false, 1 << BCH_SB_FIELD_members_v2); printf("%s", buf.buf); printbuf_exit(&buf); @@ -305,8 +305,9 @@ int cmd_show_super(int argc, char *argv[]) { "help", 0, NULL, 'h' }, { NULL } }; - unsigned fields = 1 << BCH_SB_FIELD_members; + unsigned fields = 0; bool print_layout = false; + bool print_default_fields = true; int opt; while ((opt = getopt_long(argc, argv, "f:lh", longopts, NULL)) != -1) @@ -316,6 +317,7 @@ int cmd_show_super(int argc, char *argv[]) ? ~0 : read_flag_list_or_die(optarg, bch2_sb_fields, "superblock field"); + print_default_fields = false; break; case 'l': print_layout = true; @@ -342,6 +344,11 @@ int cmd_show_super(int argc, char *argv[]) if (ret) die("Error opening %s: %s", dev, bch2_err_str(ret)); + if (print_default_fields) + fields = bch2_sb_get_members_v2(sb.sb) + ? 1 << BCH_SB_FIELD_members_v2 + : 1 << BCH_SB_FIELD_members_v1; + struct printbuf buf = PRINTBUF; buf.human_readable_units = true; -- cgit v1.2.3