Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
[PATCH] fix xip sparse file handling in ext2
Browse files Browse the repository at this point in the history
Oliver Paukstadt from our test department is testing the xip patches in
Linus' git-tree.  He found a problem that shows when reading a file that
contains sparse blocks (holes) on a -o xip mounted ext2 filesystem: the
BUG_ON() in fs/ext2/xip.c:40 triggers where it should not.  The problem was
introduced by a cleanup in my previous patch, this patch fixes it.

Signed-off-by: Carsten Otte <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Carsten Otte authored and Linus Torvalds committed Jul 27, 2005
1 parent 1872bce commit 0cfc11e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext2/xip.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ __ext2_get_sector(struct inode *inode, sector_t offset, int create,
*result = tmp.b_blocknr;

/* did we get a sparse block (hole in the file)? */
if (!(*result)) {
if (!tmp.b_blocknr && !rc) {
BUG_ON(create);
rc = -ENODATA;
}
Expand Down

0 comments on commit 0cfc11e

Please sign in to comment.