If the btree node is encrypted, this caused us to initialize found_btree_node from the encrypted header.
Unified · Split
| @@ -168,14 +168,6 @@ static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca, · 167 unmodified lines | ||
| 168 | 168 | if (BTREE_NODE_ID(bn) >= BTREE_ID_NR_MAX) |
| 169 | 169 | return; |
| 170 | 170 | |
| 171 | − bio_reset(bio, ca->disk_sb.bdev, REQ_OP_READ); | |
| 172 | − bio->bi_iter.bi_sector = offset; | |
| 173 | − bch2_bio_map(bio, b->data, c->opts.btree_node_size); | |
| 174 | − | |
| 175 | − submit_time = local_clock(); | |
| 176 | − submit_bio_wait(bio); | |
| 177 | − bch2_account_io_completion(ca, BCH_MEMBER_ERROR_read, submit_time, !bio->bi_status); | |
| 178 | − | |
| 179 | 171 | rcu_read_lock(); |
| 180 | 172 | struct found_btree_node n = { |
| 181 | 173 | .btree_id = BTREE_NODE_ID(bn), |
| @@ -192,6 +184,14 @@ static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca, · 10 unmodified lines | ||
| 192 | 184 | }; |
| 193 | 185 | rcu_read_unlock(); |
| 194 | 186 | |
| 187 | + bio_reset(bio, ca->disk_sb.bdev, REQ_OP_READ); | |
| 188 | + bio->bi_iter.bi_sector = offset; | |
| 189 | + bch2_bio_map(bio, b->data, c->opts.btree_node_size); | |
| 190 | + | |
| 191 | + submit_time = local_clock(); | |
| 192 | + submit_bio_wait(bio); | |
| 193 | + bch2_account_io_completion(ca, BCH_MEMBER_ERROR_read, submit_time, !bio->bi_status); | |
| 194 | + | |
| 195 | 195 | found_btree_node_to_key(&b->key, &n); |
| 196 | 196 | |
| 197 | 197 | CLASS(printbuf, buf)(); |