From: Carsten Otte 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 Signed-off-by: Andrew Morton --- fs/ext2/xip.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN fs/ext2/xip.c~fix-xip-sparse-file-handling-in-ext2 fs/ext2/xip.c --- devel/fs/ext2/xip.c~fix-xip-sparse-file-handling-in-ext2 2005-07-26 02:07:37.000000000 -0700 +++ devel-akpm/fs/ext2/xip.c 2005-07-26 02:07:37.000000000 -0700 @@ -36,7 +36,7 @@ __ext2_get_sector(struct inode *inode, s *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; } _