[PATCH -mm/-rc] fix xip sparse file handling in ext2

From: Carsten Otte
Date: Tue Jul 26 2005 - 04:07:14 EST


[PATCH -mm/-rc] fix xip sparse file handling in ext2
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 <cotte@xxxxxxxxxx>
---
diff -ruwN linux-git/fs/ext2/xip.c linux-git-xip-fixup/fs/ext2/xip.c
--- linux-git/fs/ext2/xip.c 2005-07-25 17:18:38.000000000 +0200
+++ linux-git-xip-fixup/fs/ext2/xip.c 2005-07-26 09:10:49.593563928 +0200
@@ -36,7 +36,7 @@
*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;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/