Skip to content

Commit a37b06d

Browse files
Doug ChapmanPhillip Lougher
authored andcommitted
Squashfs: fix breakage when page size > metadata block size
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>
1 parent 1d80cac commit a37b06d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/squashfs/cache.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries,
252252
cache->entries = entries;
253253
cache->block_size = block_size;
254254
cache->pages = block_size >> PAGE_CACHE_SHIFT;
255+
cache->pages = cache->pages ? cache->pages : 1;
255256
cache->name = name;
256257
cache->num_waiters = 0;
257258
spin_lock_init(&cache->lock);

0 commit comments

Comments
 (0)