9
0
Fork 0

ubifs: Fix reading holes in files

When a whole block of 4KiB in an ubifs file is zero then the block is
not stored in the filesystem. read_block() returns -ENOENT in this case,
so this return value must be treated as success.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2016-02-04 12:08:28 +01:00
parent ba24403f24
commit 6c57aca60d
1 changed files with 1 additions and 1 deletions

View File

@ -377,7 +377,7 @@ static int ubifs_get_block(struct ubifs_file *uf, unsigned int pos)
if (block != uf->block) {
ret = read_block(uf->inode, uf->buf, block, uf->dn);
if (ret)
if (ret && ret != -ENOENT)
return ret;
uf->block = block;
}