public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] ubifs: Fix ubifsload when using ZLIB
@ 2012-09-05 15:05 Veli-Pekka Peltola
  2012-09-07  8:00 ` Andreas Bießmann
  2012-09-10  9:39 ` Stefan Roese
  0 siblings, 2 replies; 3+ messages in thread
From: Veli-Pekka Peltola @ 2012-09-05 15:05 UTC (permalink / raw)
  To: u-boot

Using ZLIB compression with UBIFS fails if last data node is not a size of
UBIFS_BLOCK_SIZE (4096 bytes).

Easiest way to test this is trying to read a file smaller than 4k:
=> ubifsload 41000000 /etc/fstab
Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)...
UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506)
UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22
Error reading file '/etc/fstab'
/etc/fstab not found!
exit not allowed from main input shell.
=>

With this patch:

=> ubifsload 41000000 /etc/fstab
Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)...
Done
=>

Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Cc: kmpark at infradead.org
---
Changes for v2: use proper variable type

 fs/ubifs/ubifs.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index c68802b..d241774 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -37,8 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static int gzip_decompress(const unsigned char *in, size_t in_len,
 			   unsigned char *out, size_t *out_len)
 {
-	unsigned long len = in_len;
-	return zunzip(out, *out_len, (unsigned char *)in, &len, 0, 0);
+	return zunzip(out, *out_len, (unsigned char *)in, (unsigned long *)out_len, 0, 0);
 }
 
 /* Fake description object for the "none" compressor */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-10  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 15:05 [U-Boot] [PATCH v2] ubifs: Fix ubifsload when using ZLIB Veli-Pekka Peltola
2012-09-07  8:00 ` Andreas Bießmann
2012-09-10  9:39 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox