diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-03-05 08:18:25 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-03-07 13:40:38 -0500 |
commit | 3b5da96e4585a2788da6a07619bda3518d76eb30 (patch) | |
tree | 16d641a9b40682f8a027f6175bc9efe570a9687d | |
parent | 86f84779d8e92a690b2f281175ea06b884cb6fa4 (diff) |
gfs2: Fixes to "Implement iomap for block_map" (2)
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 <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
-rw-r--r-- | fs/gfs2/bmap.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 86d6a4435c87..51f940e76c5e 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -807,9 +807,6 @@ do_alloc: | |||
807 | iomap->length = hole_size(inode, lblock, &mp); | 807 | iomap->length = hole_size(inode, lblock, &mp); |
808 | else | 808 | else |
809 | iomap->length = size - pos; | 809 | iomap->length = size - pos; |
810 | } else { | ||
811 | if (height <= ip->i_height) | ||
812 | iomap->length = hole_size(inode, lblock, &mp); | ||
813 | } | 810 | } |
814 | goto out_release; | 811 | goto out_release; |
815 | } | 812 | } |