diff options
| author | Qu Wenruo <[email protected]> | 2019-05-03 00:30:54 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2019-07-01 11:34:55 +0000 |
| commit | 4c094c33c9ed4b8d0d814bd1d7ff78e123d15d00 (patch) | |
| tree | 86ef74dc7d56ae2f936d1f8c3c799daeac78f522 /fs/btrfs/dev-replace.c | |
| parent | btrfs: Remove redundant assignment of tgt_device->commit_total_bytes (diff) | |
| download | kernel-4c094c33c9ed4b8d0d814bd1d7ff78e123d15d00.tar.gz kernel-4c094c33c9ed4b8d0d814bd1d7ff78e123d15d00.zip | |
btrfs: tree-checker: Check if the file extent end overflows
Under certain conditions, we could have strange file extent item in log
tree like:
item 18 key (69599 108 397312) itemoff 15208 itemsize 53
extent data disk bytenr 0 nr 0
extent data offset 0 nr 18446744073709547520 ram 18446744073709547520
The num_bytes + ram_bytes overflow 64 bit type.
For num_bytes part, we can detect such overflow along with file offset
(key->offset), as file_offset + num_bytes should never go beyond u64.
For ram_bytes part, it's about the decompressed size of the extent, not
directly related to the size.
In theory it is OK to have a large value, and put extra limitation
on RAM bytes may cause unexpected false alerts.
So in tree-checker, we only check if the file offset and num bytes
overflow.
Signed-off-by: Qu Wenruo <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
