summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/data_update.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-13 15:12:04 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:04 -0400
commit91ecd41b7f02b95279dddcb2193af454efd39497 (patch)
tree2aa5f8fecb243e4e32ae85a23d94ce631c403f3f /fs/bcachefs/data_update.c
parent253748a26a14ae22123f3ab670ae04eb15fccc2e (diff)
downloadlinux-91ecd41b7f02b95279dddcb2193af454efd39497.tar.gz
linux-91ecd41b7f02b95279dddcb2193af454efd39497.tar.bz2
linux-91ecd41b7f02b95279dddcb2193af454efd39497.zip
bcachefs: bch2_extent_ptr_desired_durability()
This adds a new helper for getting a pointer's durability irrespective of the device state, and uses it in the the data update path. This fixes a bug where we do a data update but request 0 replicas to be allocated, because the replica being rewritten is on a device marked as failed. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r--fs/bcachefs/data_update.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c
index c89ee14f8b6b..9f7a30c7ad36 100644
--- a/fs/bcachefs/data_update.c
+++ b/fs/bcachefs/data_update.c
@@ -474,7 +474,7 @@ int bch2_data_update_init(struct btree_trans *trans,
if (crc_is_compressed(p.crc))
reserve_sectors += k.k->size;
- m->op.nr_replicas += bch2_extent_ptr_durability(c, &p);
+ m->op.nr_replicas += bch2_extent_ptr_desired_durability(c, &p);
} else if (!p.ptr.cached) {
bch2_dev_list_add_dev(&m->op.devs_have, p.ptr.dev);
}