Andreas Gruenbacher 49edd5bf42 gfs2: Fixes to "Implement iomap for block_map"
It turns out that commit 3974320ca6 "Implement iomap for block_map"
introduced a few bugs that trigger occasional failures with xfstest
generic/476:

In gfs2_iomap_begin, we jump to do_alloc when we determine that we are
beyond the end of the allocated metadata (height > ip->i_height).
There, we can end up calling hole_size with a metapath that doesn't
match the current metadata tree, which doesn't make sense.  After
untangling the code at do_alloc, fix this by checking if the block we
are looking for is within the range of allocated metadata.

In addition, add a BUG() in case gfs2_iomap_begin is accidentally called
for reading stuffed files: this is handled separately.  Make sure we
don't truncate iomap->length for reads beyond the end of the file; in
that case, the entire range counts as a hole.

Finally, revert to taking a bitmap write lock when doing allocations.
It's unclear why that change didn't lead to any failures during testing.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
2018-02-13 13:38:10 -07:00
..
2018-01-29 06:42:20 -05:00
2018-01-29 13:33:53 -08:00
2017-12-17 12:20:58 -08:00
2017-11-27 16:20:05 -05:00
2018-01-29 06:42:20 -05:00
2017-11-16 11:41:22 -08:00
2018-01-24 17:33:57 -05:00
2018-01-29 13:33:53 -08:00
2018-01-01 10:09:33 -05:00
2017-09-04 19:05:15 -04:00
2017-04-17 12:52:27 -04:00
2018-01-03 10:13:36 -08:00
2017-12-07 14:23:30 -05:00
2018-01-29 07:27:24 -08:00
2018-02-01 09:51:57 -08:00
2017-12-09 20:16:33 -05:00
2017-11-27 16:20:05 -05:00
2017-11-27 16:20:05 -05:00
2017-11-27 16:20:05 -05:00