diff options
| author | Kent Overstreet <[email protected]> | 2024-03-22 20:29:23 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2024-04-01 00:36:11 +0000 |
| commit | ec9cc18fc2e65b08c588e01f24aaeb71551a7132 (patch) | |
| tree | af145579dc99b4b2f90f9ddf72f7f20f6df45106 /fs/bcachefs/btree_trans_commit.c | |
| parent | bcachefs: Move snapshot table size to struct snapshot_table (diff) | |
| download | kernel-ec9cc18fc2e65b08c588e01f24aaeb71551a7132.tar.gz kernel-ec9cc18fc2e65b08c588e01f24aaeb71551a7132.zip | |
bcachefs: Add checks for invalid snapshot IDs
Previously, we assumed that keys were consistent with the snapshots
btree - but that's not correct as fsck may not have been run or may not
be complete.
This adds checks and error handling when using the in-memory snapshots
table (that mirrors the snapshots btree).
Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
| -rw-r--r-- | fs/bcachefs/btree_trans_commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index 30d69a6d133e..96669fede7d3 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -318,7 +318,7 @@ static inline void btree_insert_entry_checks(struct btree_trans *trans, !(i->flags & BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE) && test_bit(JOURNAL_REPLAY_DONE, &trans->c->journal.flags) && i->k->k.p.snapshot && - bch2_snapshot_is_internal_node(trans->c, i->k->k.p.snapshot)); + bch2_snapshot_is_internal_node(trans->c, i->k->k.p.snapshot) > 0); } static __always_inline int bch2_trans_journal_res_get(struct btree_trans *trans, |
