Skip to content

Commit

Permalink
Squashfs: fix breakage when page size > metadata block size
Browse files Browse the repository at this point in the history
Squashfs is broken on any system where the page size is larger than
the metadata size (8192).  This is easily fixed by ensuring cache->pages
is always > 0.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Doug Chapman <doug.chapman@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
  • Loading branch information
Doug Chapman authored and Phillip Lougher committed May 13, 2009
1 parent 1d80cac commit a37b06d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/squashfs/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a37b06d

Please sign in to comment.