Skip to content

Commit be47e0b

Browse files
author
Kent Overstreet
committed
bcachefs: KEY_TYPE_error now counts towards i_sectors
KEY_TYPE_error is used when all replicas in an extent are marked as failed; it indicates that data was present, but has been lost. So that i_sectors doesn't change when replacing extents with KEY_TYPE_error, we now have to count error keys as allocations - this fixes fsck errors later. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 6929d5e commit be47e0b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/bcachefs/extents.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ static inline bool bkey_extent_is_allocation(const struct bkey *k)
520520
case KEY_TYPE_reflink_v:
521521
case KEY_TYPE_inline_data:
522522
case KEY_TYPE_indirect_inline_data:
523+
case KEY_TYPE_error:
523524
return true;
524525
default:
525526
return false;

0 commit comments

Comments
 (0)