diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-14 00:51:48 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-14 20:02:11 -0400 |
commit | f0a73d4fde5b285d94a702026216d9fd1fd2733d (patch) | |
tree | 3be4fdd62b89b61473f21a20c8ade3adab1a3181 /fs/bcachefs/backpointers.h | |
parent | 27c15ed297cb71c2e7a839439b5a097081a32605 (diff) | |
download | linux-stable-f0a73d4fde5b285d94a702026216d9fd1fd2733d.tar.gz linux-stable-f0a73d4fde5b285d94a702026216d9fd1fd2733d.tar.bz2 linux-stable-f0a73d4fde5b285d94a702026216d9fd1fd2733d.zip |
bcachefs: Check for backpointer bucket_offset >= bucket size
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/backpointers.h')
-rw-r--r-- | fs/bcachefs/backpointers.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/bcachefs/backpointers.h b/fs/bcachefs/backpointers.h index da012ca7daee..85949b9fd880 100644 --- a/fs/bcachefs/backpointers.h +++ b/fs/bcachefs/backpointers.h @@ -53,14 +53,11 @@ static inline struct bpos bucket_pos_to_bp(const struct bch_fs *c, u64 bucket_offset) { struct bch_dev *ca = bch_dev_bkey_exists(c, bucket.inode); - struct bpos ret; - - ret = POS(bucket.inode, - (bucket_to_sector(ca, bucket.offset) << - MAX_EXTENT_COMPRESS_RATIO_SHIFT) + bucket_offset); + struct bpos ret = POS(bucket.inode, + (bucket_to_sector(ca, bucket.offset) << + MAX_EXTENT_COMPRESS_RATIO_SHIFT) + bucket_offset); EBUG_ON(!bkey_eq(bucket, bp_pos_to_bucket(c, ret))); - return ret; } |