Commit 3186c80f authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f6d0368e
...@@ -230,7 +230,11 @@ static struct journal_keys journal_keys_sort(struct list_head *journal_entries) ...@@ -230,7 +230,11 @@ static struct journal_keys journal_keys_sort(struct list_head *journal_entries)
goto err; goto err;
list_for_each_entry(p, journal_entries, list) 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) { keys.d[keys.nr++] = (struct journal_key) {
.btree_id = entry->btree_id, .btree_id = entry->btree_id,
.pos = bkey_start_pos(&k->k), .pos = bkey_start_pos(&k->k),
...@@ -239,8 +243,9 @@ static struct journal_keys journal_keys_sort(struct list_head *journal_entries) ...@@ -239,8 +243,9 @@ static struct journal_keys journal_keys_sort(struct list_head *journal_entries)
keys.journal_seq_base, keys.journal_seq_base,
.journal_offset = k->_data - p->j._data, .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; i = keys.d;
while (i < keys.d + keys.nr) { while (i < keys.d + keys.nr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment