mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 23:29:10 -04:00
bcachefs: Skip 0 size deleted extents in journal replay
These are created by the new extent update path, but not used yet by the recovery code and they break the existing recovery code, so we can just skip them. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
f6d0368e06
commit
3186c80fe9
@@ -230,7 +230,11 @@ static struct journal_keys journal_keys_sort(struct list_head *journal_entries)
|
||||
goto err;
|
||||
|
||||
list_for_each_entry(p, journal_entries, list)
|
||||
for_each_jset_key(k, _n, entry, &p->j)
|
||||
for_each_jset_key(k, _n, entry, &p->j) {
|
||||
if (bkey_deleted(&k->k) &&
|
||||
btree_node_type_is_extents(entry->btree_id))
|
||||
continue;
|
||||
|
||||
keys.d[keys.nr++] = (struct journal_key) {
|
||||
.btree_id = entry->btree_id,
|
||||
.pos = bkey_start_pos(&k->k),
|
||||
@@ -239,8 +243,9 @@ static struct journal_keys journal_keys_sort(struct list_head *journal_entries)
|
||||
keys.journal_seq_base,
|
||||
.journal_offset = k->_data - p->j._data,
|
||||
};
|
||||
}
|
||||
|
||||
sort(keys.d, nr_keys, sizeof(keys.d[0]), journal_sort_key_cmp, NULL);
|
||||
sort(keys.d, keys.nr, sizeof(keys.d[0]), journal_sort_key_cmp, NULL);
|
||||
|
||||
i = keys.d;
|
||||
while (i < keys.d + keys.nr) {
|
||||
|
||||
Reference in New Issue
Block a user