Skip to content

Commit 3b5da96

Browse files
Andreas GruenbacherAstralBob
authored andcommitted
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 <[email protected]> Signed-off-by: Bob Peterson <[email protected]>
1 parent 86f8477 commit 3b5da96

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

fs/gfs2/bmap.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,6 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
807807
iomap->length = hole_size(inode, lblock, &mp);
808808
else
809809
iomap->length = size - pos;
810-
} else {
811-
if (height <= ip->i_height)
812-
iomap->length = hole_size(inode, lblock, &mp);
813810
}
814811
goto out_release;
815812
}

0 commit comments

Comments
 (0)