lkml.org 
[lkml]   [2009]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] squashfs broken when pageszie > blocksize
From
Date
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);



\
 
 \ /
  Last update: 2009-04-13 21:59    [W:0.044 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site