summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2018-03-23 07:33:25 -0700
committerBob Peterson <rpeterso@redhat.com>2018-03-23 11:43:02 -0700
commitbb491ce67aa7c1635e5ae4f2f304a7d13d3dbe71 (patch)
tree540adba82703cd5cf8945be87af452f35ddc1c31 /fs/gfs2/file.c
parentee6ed857c8058177614b21a0efbf27e02c4e2a77 (diff)
downloadlinux-stable-bb491ce67aa7c1635e5ae4f2f304a7d13d3dbe71.tar.gz
linux-stable-bb491ce67aa7c1635e5ae4f2f304a7d13d3dbe71.tar.bz2
linux-stable-bb491ce67aa7c1635e5ae4f2f304a7d13d3dbe71.zip
gfs2: Check for the end of metadata in punch_hole
When punching a hole or truncating an inode down to a given size, also check if the truncate point / start of the hole is within the range we have metadata for. Otherwise, we can end up freeing blocks that shouldn't be freed, corrupting the inode, or crashing the machine when trying to punch a hole into the void. When growing an inode via truncate, we set the new size but we don't allocate additional levels of indirect blocks and grow the inode height. When shrinking that inode again, the new size may still point beyond the end of the inode's metadata. Fixes xfstest generic/476. Debugged-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/file.c')
0 files changed, 0 insertions, 0 deletions