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:
parent
ba24403f24
commit
6c57aca60d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue