提交 0cfc11ed 编写于 作者: C Carsten Otte 提交者: Linus Torvalds

[PATCH] 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: NCarsten Otte <cotte@de.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1872bceb
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册