Skip to content

Commit

Permalink
gfs2: Fixes to "Implement iomap for block_map" (2)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Gruenbacher authored and Bob Peterson committed Mar 7, 2018
1 parent 86f8477 commit 3b5da96
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,6 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
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;
}
Expand Down

0 comments on commit 3b5da96

Please sign in to comment.