summaryrefslogtreecommitdiff
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2019-11-06 14:09:25 +0000
committerAndreas Gruenbacher <agruenba@redhat.com>2019-11-07 21:02:35 +0100
commit184b4e60853dfeef36b96948ab8fedb7e271063c (patch)
tree490cc2893f4da8ab096ee66ad07a5491408b68ec /fs/gfs2/bmap.c
parentf53056c43063257ae4159d83c425eaeb772bcd71 (diff)
gfs2: Fix end-of-file handling in gfs2_page_mkwrite
When the filesystem block size is smaller than the page size, the last page may contain blocks that lie entirely beyond the end of the file. Make sure to only allocate blocks that lie at least partially in the file. Allocating blocks beyond that isn't useful, and what's more, they will not be zeroed out and may end up containing random data. With that change in place, make sure we'll still always unstuff stuffed inodes: iomap_writepage and iomap_writepages currently can't handle stuffed files. In addition, simplify and move the end-of-file check further to the top in gfs2_page_mkwrite to avoid weird side effects like unstuffing when we're not. Fixes xfstest generic/263. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
0 files changed, 0 insertions, 0 deletions