diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-04 12:08:28 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-04 12:22:41 +0100 |
commit | 6c57aca60d421e7d689a741833fce7b59a23691c (patch) | |
tree | 2a0b5389c080b57f417abd1d2e257659786a0036 /fs/ubifs/ubifs.c | |
parent | ba24403f24cfd8c461e9b087a81d2e16efed418f (diff) | |
download | barebox-6c57aca60d421e7d689a741833fce7b59a23691c.tar.gz barebox-6c57aca60d421e7d689a741833fce7b59a23691c.tar.xz |
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>
Diffstat (limited to 'fs/ubifs/ubifs.c')
-rw-r--r-- | fs/ubifs/ubifs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 4368203bad..ad74a0be18 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -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; } |