]> www.infradead.org Git - users/dwmw2/linux.git/commit
gfs2: gfs2_walk_metadata fix
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 5 Aug 2019 11:22:03 +0000 (12:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:10:56 +0000 (10:10 +0200)
commit86bc3da5ee7251b1c3640dbcdb0c5f1a2dda290b
tree20b156b7cfd776feed54f8c715c9808d6c5c6903
parentbb3db40acb4cb29e9c2389581edf73a52d9e8973
gfs2: gfs2_walk_metadata fix

commit a27a0c9b6a208722016c8ec5ad31ec96082b91ec upstream.

It turns out that the current version of gfs2_metadata_walker suffers
from multiple problems that can cause gfs2_hole_size to report an
incorrect size.  This will confuse fiemap as well as lseek with the
SEEK_DATA flag.

Fix that by changing gfs2_hole_walker to compute the metapath to the
first data block after the hole (if any), and compute the hole size
based on that.

Fixes xfstest generic/490.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Bob Peterson <rpeterso@redhat.com>
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/bmap.c