diff --git a/.bcachefs_revision b/.bcachefs_revision index f3aeb2c0..295ed546 100644 --- a/.bcachefs_revision +++ b/.bcachefs_revision @@ -1 +1 @@ -176718966e14c5f832ead8cea2e0e45aba51f5ef +26202210393adf3fce3d98a3a2598c21d07b5634 diff --git a/libbcachefs/bcachefs.h b/libbcachefs/bcachefs.h index 53e7b5a0..fc451e46 100644 --- a/libbcachefs/bcachefs.h +++ b/libbcachefs/bcachefs.h @@ -557,13 +557,13 @@ struct journal_seq_blacklist_table { struct journal_keys { struct journal_key { + u64 journal_seq; + u32 journal_offset; enum btree_id btree_id:8; unsigned level:8; bool allocated; bool overwritten; struct bkey_i *k; - u32 journal_seq; - u32 journal_offset; } *d; /* * Gap buffer: instead of all the empty space in the array being at the @@ -573,7 +573,6 @@ struct journal_keys { size_t gap; size_t nr; size_t size; - u64 journal_seq_base; }; struct btree_path_buf { diff --git a/libbcachefs/recovery.c b/libbcachefs/recovery.c index b070bdf0..18f6ec5c 100644 --- a/libbcachefs/recovery.c +++ b/libbcachefs/recovery.c @@ -223,7 +223,6 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id, struct journal_keys new_keys = { .nr = keys->nr, .size = max_t(size_t, keys->size, 8) * 2, - .journal_seq_base = keys->journal_seq_base, }; new_keys.d = kvmalloc(sizeof(new_keys.d[0]) * new_keys.size, GFP_KERNEL); @@ -494,9 +493,6 @@ static int journal_keys_sort(struct bch_fs *c) if (!i || i->ignore) continue; - if (!keys->journal_seq_base) - keys->journal_seq_base = le64_to_cpu(i->j.seq); - for_each_jset_key(k, _n, entry, &i->j) nr_keys++; } @@ -516,15 +512,12 @@ static int journal_keys_sort(struct bch_fs *c) if (!i || i->ignore) continue; - BUG_ON(le64_to_cpu(i->j.seq) - keys->journal_seq_base > U32_MAX); - for_each_jset_key(k, _n, entry, &i->j) keys->d[keys->nr++] = (struct journal_key) { .btree_id = entry->btree_id, .level = entry->level, .k = k, - .journal_seq = le64_to_cpu(i->j.seq) - - keys->journal_seq_base, + .journal_seq = le64_to_cpu(i->j.seq), .journal_offset = k->_data - i->j._data, }; } @@ -618,15 +611,12 @@ static int bch2_journal_replay(struct bch_fs *c) sizeof(keys_sorted[0]), journal_sort_seq_cmp, NULL); - if (keys->nr) - replay_now_at(j, keys->journal_seq_base); - for (i = 0; i < keys->nr; i++) { k = keys_sorted[i]; cond_resched(); - replay_now_at(j, keys->journal_seq_base + k->journal_seq); + replay_now_at(j, k->journal_seq); ret = bch2_trans_do(c, NULL, NULL, BTREE_INSERT_LAZY_RW| diff --git a/libbcachefs/str_hash.h b/libbcachefs/str_hash.h index 5c327b31..560983df 100644 --- a/libbcachefs/str_hash.h +++ b/libbcachefs/str_hash.h @@ -144,7 +144,9 @@ struct bch_hash_desc { static inline bool is_visible_key(struct bch_hash_desc desc, subvol_inum inum, struct bkey_s_c k) { return k.k->type == desc.key_type && - (!desc.is_visible || desc.is_visible(inum, k)); + (!desc.is_visible || + !inum.inum || + desc.is_visible(inum, k)); } static __always_inline int @@ -258,7 +260,7 @@ int bch2_hash_set_snapshot(struct btree_trans *trans, snapshot), POS(insert->k.p.inode, U64_MAX), BTREE_ITER_SLOTS|BTREE_ITER_INTENT, k, ret) { - if (!inum.subvol || is_visible_key(desc, inum, k)) { + if (is_visible_key(desc, inum, k)) { if (!desc.cmp_bkey(k, bkey_i_to_s_c(insert))) goto found;