* [PATCH] ubifs: Fix reading holes in files
@ 2016-02-04 11:21 Sascha Hauer
0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2016-02-04 11:21 UTC (permalink / raw)
To: Barebox List
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>
---
fs/ubifs/ubifs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index a9189f7..1f31f6f 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;
}
--
2.7.0.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-02-04 11:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04 11:21 [PATCH] ubifs: Fix reading holes in files Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox