gfs2: Fix length of holes reported at end-of-file
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 5 Nov 2021 23:18:56 +0000 (00:18 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Sat, 6 Nov 2021 09:25:45 +0000 (10:25 +0100)
commitf3506eee81d1f700d9ee2d2f4a88fddb669ec032
tree6edb05823f005e0581782b4c9a704817f950c13f
parent49462e2be119d38c5eb5759d0d1b712df3a41239
gfs2: Fix length of holes reported at end-of-file

Fix the length of holes reported at the end of a file: the length is
relative to the beginning of the extent, not the seek position which is
rounded down to the filesystem block size.

This bug went unnoticed for some time, but is now caught by the
following assertion in iomap_iter_done():

  WARN_ON_ONCE(iter->iomap.offset + iter->iomap.length <= iter->pos)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/bmap.c