mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] squashfs broken when pageszie > blocksize
@ 2009-04-13 19:57 Doug Chapman
  2009-04-13 22:51 ` Phillip Lougher
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Chapman @ 2009-04-13 19:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: phillip

Squashfs is broken on any system where the pageszie is larger than either
the block size of the squashfs image or larger than the metadata size (8192).
This is easily fixed by ensuring cache->pages is always > 0.

Signed-off-by: Doug Chapman <doug.chapman@hp.com>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>

---
diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c
index 1c4739e..c31aa89 100644
--- a/fs/squashfs/cache.c
+++ b/fs/squashfs/cache.c
@@ -252,6 +252,7 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries,
 	cache->entries = entries;
 	cache->block_size = block_size;
 	cache->pages = block_size >> PAGE_CACHE_SHIFT;
+	cache->pages = cache->pages?cache->pages:1;
 	cache->name = name;
 	cache->num_waiters = 0;
 	spin_lock_init(&cache->lock);



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

end of thread, other threads:[~2009-04-21  0:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-13 19:57 [PATCH] squashfs broken when pageszie > blocksize Doug Chapman
2009-04-13 22:51 ` Phillip Lougher
2009-04-17 13:20   ` Geert Uytterhoeven
2009-04-21  0:02     ` [Squashfs-devel] " Phillip Lougher

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

Powered by JetHome