gfs2: Fix invalid metadata access in punch_hole
authorAndrew Price <anprice@redhat.com>
Mon, 11 Mar 2024 15:40:36 +0000 (16:40 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 11 Mar 2024 16:11:18 +0000 (17:11 +0100)
commitc95346ac918c5badf51b9a7ac58a26d3bd5bb224
tree23318b896bd0e2aca3387de5806cd39f58fde727
parente8f897f4afef0031fe618a8e94127a0934896aba
gfs2: Fix invalid metadata access in punch_hole

In punch_hole(), when the offset lies in the final block for a given
height, there is no hole to punch, but the maximum size check fails to
detect that.  Consequently, punch_hole() will try to punch a hole beyond
the end of the metadata and fail.  Fix the maximum size check.

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