diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-13 15:12:04 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:04 -0400 |
commit | 91ecd41b7f02b95279dddcb2193af454efd39497 (patch) | |
tree | 2aa5f8fecb243e4e32ae85a23d94ce631c403f3f /fs/bcachefs/extents.h | |
parent | 253748a26a14ae22123f3ab670ae04eb15fccc2e (diff) | |
download | lwn-91ecd41b7f02b95279dddcb2193af454efd39497.tar.gz lwn-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/extents.h')
-rw-r--r-- | fs/bcachefs/extents.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h index 31c8140950e0..3ba41e37d864 100644 --- a/fs/bcachefs/extents.h +++ b/fs/bcachefs/extents.h @@ -610,6 +610,7 @@ bool bch2_bkey_is_incompressible(struct bkey_s_c); unsigned bch2_bkey_sectors_compressed(struct bkey_s_c); unsigned bch2_bkey_replicas(struct bch_fs *, struct bkey_s_c); +unsigned bch2_extent_ptr_desired_durability(struct bch_fs *, struct extent_ptr_decoded *); unsigned bch2_extent_ptr_durability(struct bch_fs *, struct extent_ptr_decoded *); unsigned bch2_bkey_durability(struct bch_fs *, struct bkey_s_c); |