mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-27 14:14:30 +08:00
407a8721b6
intersect_with_reserved() currently succeeds if (bytenr + num_bytes) is greater than or equal to the first address in the range, assuming that bytenr is also not past the end of the range. This is wrong. (bytenr + num bytes) is one byte past the last address in the range we're checking, meaning that our range only overlaps the reserved range if it's strictly greater than the reserved range's start address. For example, imagine a range at 0x3000 with length 0x1000 that we're checking against a reserved range that starts at 0x4000. The addresses in our range are 0x3000-0x3fff: it doesn't overlap. But the current check, (0x3000 + 0x1000 >= 0x4000), will erroneously pass. Fix the issue by changing >= to >. Issue: #297 Issue: #349 Author: Thomas Hebb <tommyhebb@gmail.com> Pull-request: #494 Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
common.c | ||
common.h | ||
main.c | ||
Makefile | ||
source-ext2.c | ||
source-ext2.h | ||
source-fs.c | ||
source-fs.h | ||
source-reiserfs.c | ||
source-reiserfs.h |