Skip to content

Commit af2ff37

Browse files
author
Kent Overstreet
committed
bcachefs: Fix block/btree node size defaults
We're fixing option parsing in userspace, it now obeys OPT_SB_FIELD_SECTORS Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 5d361ae commit af2ff37

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

fs/bcachefs/opts.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,12 +684,10 @@ void __bch2_opt_set_sb(struct bch_sb *sb, int dev_idx,
684684
if (opt->flags & OPT_SB_FIELD_ONE_BIAS)
685685
v++;
686686

687-
if ((opt->flags & OPT_FS) && opt->set_sb)
687+
if ((opt->flags & OPT_FS) && opt->set_sb && dev_idx < 0)
688688
opt->set_sb(sb, v);
689689

690-
if ((opt->flags & OPT_DEVICE) &&
691-
opt->set_member &&
692-
dev_idx >= 0) {
690+
if ((opt->flags & OPT_DEVICE) && opt->set_member && dev_idx >= 0) {
693691
if (WARN(!bch2_member_exists(sb, dev_idx),
694692
"tried to set device option %s on nonexistent device %i",
695693
opt->attr.name, dev_idx))

fs/bcachefs/opts.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ enum fsck_err_opts {
128128
OPT_FS|OPT_FORMAT| \
129129
OPT_HUMAN_READABLE|OPT_MUST_BE_POW_2|OPT_SB_FIELD_SECTORS, \
130130
OPT_UINT(512, 1U << 16), \
131-
BCH_SB_BLOCK_SIZE, 8, \
131+
BCH_SB_BLOCK_SIZE, 4 << 10, \
132132
"size", NULL) \
133133
x(btree_node_size, u32, \
134134
OPT_FS|OPT_FORMAT| \
135135
OPT_HUMAN_READABLE|OPT_MUST_BE_POW_2|OPT_SB_FIELD_SECTORS, \
136136
OPT_UINT(512, 1U << 20), \
137-
BCH_SB_BTREE_NODE_SIZE, 512, \
137+
BCH_SB_BTREE_NODE_SIZE, 256 << 10, \
138138
"size", "Btree node size, default 256k") \
139139
x(errors, u8, \
140140
OPT_FS|OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
@@ -499,11 +499,6 @@ enum fsck_err_opts {
499499
OPT_STR(bch2_member_states), \
500500
BCH_MEMBER_STATE, BCH_MEMBER_STATE_rw, \
501501
"state", "rw,ro,failed,spare") \
502-
x(fs_size, u64, \
503-
OPT_DEVICE|OPT_HIDDEN, \
504-
OPT_UINT(0, S64_MAX), \
505-
BCH2_NO_MEMBER_OPT, 0, \
506-
"size", "Size of filesystem on device") \
507502
x(bucket_size, u32, \
508503
OPT_DEVICE|OPT_HUMAN_READABLE|OPT_SB_FIELD_SECTORS, \
509504
OPT_UINT(0, S64_MAX), \

0 commit comments

Comments
 (0)