Btrfs: return error if the range we want to map is bogus
authorJosef Bacik <josef@redhat.com>
Tue, 15 Mar 2011 18:52:12 +0000 (14:52 -0400)
committerJosef Bacik <josef@redhat.com>
Thu, 17 Mar 2011 18:21:35 +0000 (14:21 -0400)
Currently if we have corrupt metadata map_extent_buffer will complain about it,
but not return an error so the caller has no idea a problem was hit.  Fix this.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/extent_io.c

index 714adc4ac4c24eaae26900bb9e862bc8b874432b..1bbd26b4fc5cf068c960726adeec7453768cadc4 100644 (file)
@@ -3690,6 +3690,7 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
                       "wanted %lu %lu\n", (unsigned long long)eb->start,
                       eb->len, start, min_len);
                WARN_ON(1);
+               return -EINVAL;
        }
 
        p = extent_buffer_page(eb, i);