diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-09-15 14:37:07 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-09-15 14:38:20 -0400 |
commit | 5dd5a0d3e21ac1516ccd0d9bd798df6b05a5863b (patch) | |
tree | ae6d0a2cebfb3717a3aa0ac0f250e0ad4acea83c | |
parent | 4eefef7868a260c1dc8abfc206a7dc33341558be (diff) |
Update bcachefs sources to f611e3b87fb5 bcachefs: kill build warning in userspace
-rw-r--r-- | .bcachefs_revision | 2 | ||||
-rw-r--r-- | libbcachefs/data_update.c | 2 | ||||
-rw-r--r-- | libbcachefs/errcode.h | 1 | ||||
-rw-r--r-- | libbcachefs/io_read.c | 13 | ||||
-rw-r--r-- | libbcachefs/super.c | 6 |
5 files changed, 16 insertions, 8 deletions
diff --git a/.bcachefs_revision b/.bcachefs_revision index 5fc72f30..432a3c67 100644 --- a/.bcachefs_revision +++ b/.bcachefs_revision @@ -1 +1 @@ -1c8d3fc41e7291ee39458e225a1ceac76bb8d8f1 +f611e3b87fb56b9a0f68b9e2b7110ead92fc5840 diff --git a/libbcachefs/data_update.c b/libbcachefs/data_update.c index ca925c5d..f23951a1 100644 --- a/libbcachefs/data_update.c +++ b/libbcachefs/data_update.c @@ -701,7 +701,7 @@ int bch2_extent_drop_ptrs(struct btree_trans *trans, return ret; const union bch_extent_entry *entry; - struct extent_ptr_decoded p; + struct extent_ptr_decoded p = {}; unsigned i = 0; bkey_for_each_ptr_decode(k.k, bch2_bkey_ptrs_c(k), p, entry) { if (data_opts->kill_ec_ptrs & BIT(i)) diff --git a/libbcachefs/errcode.h b/libbcachefs/errcode.h index 420f6922..c4344a1d 100644 --- a/libbcachefs/errcode.h +++ b/libbcachefs/errcode.h @@ -353,6 +353,7 @@ x(BCH_ERR_btree_node_read_err, btree_node_read_err_incompatible) \ x(0, nopromote) \ x(BCH_ERR_nopromote, nopromote_may_not) \ + x(BCH_ERR_nopromote, nopromote_no_rewrites) \ x(BCH_ERR_nopromote, nopromote_already_promoted) \ x(BCH_ERR_nopromote, nopromote_unwritten) \ x(BCH_ERR_nopromote, nopromote_congested) \ diff --git a/libbcachefs/io_read.c b/libbcachefs/io_read.c index 3765aa52..8b4cda1d 100644 --- a/libbcachefs/io_read.c +++ b/libbcachefs/io_read.c @@ -31,10 +31,15 @@ #include <linux/random.h> #include <linux/sched/mm.h> +static unsigned __maybe_unused bch2_read_corrupt_ratio; +static int __maybe_unused bch2_read_corrupt_device; + #ifdef CONFIG_BCACHEFS_DEBUG -static unsigned bch2_read_corrupt_ratio; module_param_named(read_corrupt_ratio, bch2_read_corrupt_ratio, uint, 0644); MODULE_PARM_DESC(read_corrupt_ratio, ""); + +module_param_named(read_corrupt_device, bch2_read_corrupt_device, int, 0644); +MODULE_PARM_DESC(read_corrupt_device, ""); #endif static bool bch2_poison_extents_on_checksum_error; @@ -277,7 +282,7 @@ static struct bch_read_bio *__promote_alloc(struct btree_trans *trans, } if (!update_opts.rewrite_ptrs) - return NULL; + return ERR_PTR(bch_err_throw(c, nopromote_no_rewrites)); } if (!enumerated_ref_tryget(&c->writes, BCH_WRITE_REF_promote)) @@ -879,7 +884,9 @@ static void __bch2_read_endio(struct work_struct *work) src->bi_iter = rbio->bvec_iter; } - bch2_maybe_corrupt_bio(src, bch2_read_corrupt_ratio); + if (bch2_read_corrupt_device == rbio->pick.ptr.dev || + bch2_read_corrupt_device < 0) + bch2_maybe_corrupt_bio(src, bch2_read_corrupt_ratio); csum = bch2_checksum_bio(c, crc.csum_type, nonce, src); bool csum_good = !bch2_crc_cmp(csum, rbio->pick.crc.csum) || c->opts.no_data_io; diff --git a/libbcachefs/super.c b/libbcachefs/super.c index 03b12c2d..4b873694 100644 --- a/libbcachefs/super.c +++ b/libbcachefs/super.c @@ -2437,10 +2437,10 @@ static bool bch2_dev_will_resize_on_mount(struct bch_dev *ca) static bool bch2_fs_will_resize_on_mount(struct bch_fs *c) { + bool ret = false; for_each_online_member(c, ca, BCH_DEV_READ_REF_fs_resize_on_mount) - if (bch2_dev_will_resize_on_mount(ca)) - return true; - return false; + ret |= bch2_dev_will_resize_on_mount(ca); + return ret; } int bch2_fs_resize_on_mount(struct bch_fs *c) |