Commit a37b06d589f2c687a38d07569f4ef97c650fde39
Committed by
Phillip Lougher
1 parent
1d80cac0fe
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff
fs/squashfs/cache.c
... | ... | @@ -252,6 +252,7 @@ |
252 | 252 | cache->entries = entries; |
253 | 253 | cache->block_size = block_size; |
254 | 254 | cache->pages = block_size >> PAGE_CACHE_SHIFT; |
255 | + cache->pages = cache->pages ? cache->pages : 1; | |
255 | 256 | cache->name = name; |
256 | 257 | cache->num_waiters = 0; |
257 | 258 | spin_lock_init(&cache->lock); |