Update bcachefs sources to 81f1897f3d8d debug patch for gregor

This commit is contained in:
Kent Overstreet 2025-11-21 10:45:11 -05:00
parent c2e3300b21
commit 22adbc519b
7 changed files with 37 additions and 12 deletions

View File

@ -1 +1 @@
2f55ab5899a1e409e30d24303d77a67ba0a2efd0
81f1897f3d8ddf1cce41646b93ec612690bca8ad

View File

@ -821,6 +821,7 @@ struct bch_fs {
struct bch_opts opts;
atomic_t opt_change_cookie;
struct bch_opts_mask mount_opts;
unsigned loglevel;
unsigned prev_loglevel;

View File

@ -706,11 +706,14 @@ static ssize_t sysfs_opt_store(struct bch_fs *c,
BUG();
}
if (!ca)
bch2_opt_set_by_id(&c->opts, id, v);
if (changed) {
if (!ca) {
bch2_opt_set_by_id(&c->opts, id, v);
clear_bit(id, c->mount_opts.d);
}
if (changed)
bch2_opt_hook_post_set(c, ca, 0, id, v);
}
ret = size;
err:

View File

@ -366,8 +366,10 @@ int __bch2_inode_peek(struct btree_trans *trans,
return 0;
err:
if (warn)
if (warn && should_print_err(ret)) {
bch_err_msg(trans->c, ret, "looking up inum %llu:%llu:", inum.subvol, inum.inum);
dump_stack();
}
return ret;
}

View File

@ -508,6 +508,7 @@ void bch2_opt_to_text(struct printbuf *out,
void bch2_opts_to_text(struct printbuf *out,
struct bch_opts opts,
struct bch_fs *c, struct bch_sb *sb,
struct bch_opts_mask *mask,
unsigned show_mask, unsigned hide_mask,
unsigned flags)
{
@ -519,6 +520,9 @@ void bch2_opts_to_text(struct printbuf *out,
if ((opt->flags & hide_mask) || !(opt->flags & show_mask))
continue;
if (mask && !test_bit(i, mask->d))
continue;
u64 v = bch2_opt_get_by_id(&opts, i);
if (v == bch2_opt_get_by_id(&bch2_opts_default, i))
continue;

View File

@ -563,6 +563,17 @@ enum fsck_err_opts {
NULL, "BTREE_ITER_prefetch causes btree nodes to be\n"\
" prefetched sequentially")
enum bch_opt_id {
#define x(_name, ...) Opt_##_name,
BCH_OPTS()
#undef x
bch2_opts_nr
};
struct bch_opts_mask {
unsigned long d[BITS_TO_LONGS(bch2_opts_nr)];
};
struct bch_opts {
#define x(_name, _bits, ...) unsigned _name##_defined:1;
BCH_OPTS()
@ -607,13 +618,6 @@ static inline struct bch_opts bch2_opts_empty(void)
void bch2_opts_apply(struct bch_opts *, struct bch_opts);
enum bch_opt_id {
#define x(_name, ...) Opt_##_name,
BCH_OPTS()
#undef x
bch2_opts_nr
};
struct bch_fs;
struct printbuf;
@ -664,6 +668,7 @@ void bch2_opt_to_text(struct printbuf *, struct bch_fs *, struct bch_sb *,
void bch2_opts_to_text(struct printbuf *,
struct bch_opts,
struct bch_fs *, struct bch_sb *,
struct bch_opts_mask *,
unsigned, unsigned, unsigned);
int bch2_opt_hook_pre_set(struct bch_fs *, struct bch_dev *, u64, enum bch_opt_id, u64, bool);

View File

@ -2015,6 +2015,7 @@ static int bch2_show_options(struct seq_file *seq, struct dentry *root)
CLASS(printbuf, buf)();
bch2_opts_to_text(&buf, c->opts, c, c->disk_sb.sb,
&c->mount_opts,
OPT_MOUNT, OPT_HIDDEN, OPT_SHOW_MOUNT_STYLE);
printbuf_nul_terminate(&buf);
seq_printf(seq, ",%s", buf.buf);
@ -2098,6 +2099,13 @@ static int bch2_test_super(struct super_block *s, void *data)
return true;
}
static void set_mount_opts(struct bch_fs *c, struct bch_opts *opts)
{
for (enum bch_opt_id id = 0; id < bch2_opts_nr; id++)
if (bch2_opt_defined_by_id(opts, id))
set_bit(id, c->mount_opts.d);
}
static int bch2_fs_get_tree(struct fs_context *fc)
{
struct bch_fs *c;
@ -2134,6 +2142,7 @@ static int bch2_fs_get_tree(struct fs_context *fc)
if (opt_defined(opts, discard))
set_bit(BCH_FS_discard_mount_opt_set, &c->flags);
set_mount_opts(c, &opts);
/* Some options can't be parsed until after the fs is started: */
opts = bch2_opts_empty();
@ -2142,6 +2151,7 @@ static int bch2_fs_get_tree(struct fs_context *fc)
goto err_stop_fs;
bch2_opts_apply(&c->opts, opts);
set_mount_opts(c, &opts);
ret = bch2_fs_start(c);
if (ret)