From: Andreas Gruenbacher Date: Mon, 5 Mar 2018 13:18:25 +0000 (-0700) Subject: gfs2: Fixes to "Implement iomap for block_map" (2) X-Git-Tag: v4.15.11~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae53e57f59115cc5f08031e7e5b14e6b057e4323;p=thirdparty%2Fkernel%2Fstable.git gfs2: Fixes to "Implement iomap for block_map" (2) commit 3b5da96e4585a2788da6a07619bda3518d76eb30 upstream. It turns out that commit 3229c18c0d6b2 'Fixes to "Implement iomap for block_map"' introduced another bug in gfs2_iomap_begin that can cause gfs2_block_map to set bh->b_size of an actual buffer to 0. This can lead to arbitrary incorrect behavior including crashes or disk corruption. Revert the incorrect part of that commit. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 76de441b4d9fd..f13e986696f7b 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -811,9 +811,6 @@ do_alloc: iomap->length = hole_size(inode, lblock, &mp); else iomap->length = size - pos; - } else { - if (height <= ip->i_height) - iomap->length = hole_size(inode, lblock, &mp); } goto out_release; }