Skip to content

Commit 210af91

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus: Squashfs: cody tidying, remove commented out line in Makefile Squashfs: check page size is not larger than the filesystem block size Squashfs: fix breakage when page size > metadata block size
2 parents a6aeeeb + e5d2875 commit 210af91

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

fs/squashfs/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
obj-$(CONFIG_SQUASHFS) += squashfs.o
66
squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
77
squashfs-y += namei.o super.o symlink.o
8-
#squashfs-y += squashfs2_0.o

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);

fs/squashfs/super.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
157157
if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE)
158158
goto failed_mount;
159159

160+
/*
161+
* Check the system page size is not larger than the filesystem
162+
* block size (by default 128K). This is currently not supported.
163+
*/
164+
if (PAGE_CACHE_SIZE > msblk->block_size) {
165+
ERROR("Page size > filesystem block size (%d). This is "
166+
"currently not supported!\n", msblk->block_size);
167+
goto failed_mount;
168+
}
169+
160170
msblk->block_log = le16_to_cpu(sblk->block_log);
161171
if (msblk->block_log > SQUASHFS_FILE_MAX_LOG)
162172
goto failed_mount;

0 commit comments

Comments
 (0)