diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-22 00:15:41 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-31 20:36:10 -0400 |
commit | a5e3dce493d4b12b74000b6a99b6712afa5d1a4d (patch) | |
tree | 11a0e6e6e71218fbe1473fe6678d1547d6868d3d /fs/bcachefs/backpointers.c | |
parent | 39cd87c4eb2b893354f3b850f916353f2658ae6f (diff) | |
download | linux-stable-a5e3dce493d4b12b74000b6a99b6712afa5d1a4d.tar.gz linux-stable-a5e3dce493d4b12b74000b6a99b6712afa5d1a4d.tar.bz2 linux-stable-a5e3dce493d4b12b74000b6a99b6712afa5d1a4d.zip |
bcachefs: Fix assert in bch2_backpointer_invalid()
Backpointers that point to invalid devices are caught by fsck, not
.key_invalid; so .key_invalid needs to check for them instead of hitting
asserts.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/backpointers.c')
-rw-r--r-- | fs/bcachefs/backpointers.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index 8cb35ea572cb..21b3ae7df824 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -44,6 +44,11 @@ int bch2_backpointer_invalid(struct bch_fs *c, struct bkey_s_c k, struct printbuf *err) { struct bkey_s_c_backpointer bp = bkey_s_c_to_backpointer(k); + + /* these will be caught by fsck */ + if (!bch2_dev_exists2(c, bp.k->p.inode)) + return 0; + struct bpos bucket = bp_pos_to_bucket(c, bp.k->p); int ret = 0; |