diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/volumes.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 76ded9eb77a7..c8a315d4b86f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4406,10 +4406,16 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, | |||
4406 | btrfs_crit(fs_info, "unable to find logical %llu len %llu", | 4406 | btrfs_crit(fs_info, "unable to find logical %llu len %llu", |
4407 | (unsigned long long)logical, | 4407 | (unsigned long long)logical, |
4408 | (unsigned long long)*length); | 4408 | (unsigned long long)*length); |
4409 | BUG(); | 4409 | return -EINVAL; |
4410 | } | ||
4411 | |||
4412 | if (em->start > logical || em->start + em->len < logical) { | ||
4413 | btrfs_crit(fs_info, "found a bad mapping, wanted %Lu, " | ||
4414 | "found %Lu-%Lu\n", logical, em->start, | ||
4415 | em->start + em->len); | ||
4416 | return -EINVAL; | ||
4410 | } | 4417 | } |
4411 | 4418 | ||
4412 | BUG_ON(em->start > logical || em->start + em->len < logical); | ||
4413 | map = (struct map_lookup *)em->bdev; | 4419 | map = (struct map_lookup *)em->bdev; |
4414 | offset = logical - em->start; | 4420 | offset = logical - em->start; |
4415 | 4421 | ||