aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorplougher <plougher>2008-10-16 10:03:36 +0000
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 12:34:07 -0800
commit37f71a72d096b8ee99bdf1923330277b0ff6f1e2 (patch)
tree2a3fb8936234b7f361569f560c6213a6c56b18f1 /kernel
parent3cb4f276fda256d6db01b646f6e941f5cca7d35a (diff)
downloadsquashfs-tools-37f71a72d096b8ee99bdf1923330277b0ff6f1e2.tar.gz
Add compression type to mount time check
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fs/squashfs/super.c11
-rw-r--r--kernel/include/linux/squashfs_fs.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/kernel/fs/squashfs/super.c b/kernel/fs/squashfs/super.c
index ac493ca..84c74b2 100644
--- a/kernel/fs/squashfs/super.c
+++ b/kernel/fs/squashfs/super.c
@@ -45,7 +45,8 @@
static struct file_system_type squashfs_fs_type;
static struct super_operations squashfs_super_ops;
-static int supported_squashfs_filesystem(short major, short minor, int silent)
+static int supported_squashfs_filesystem(short major, short minor,
+ short compression, int silent)
{
if (major < SQUASHFS_MAJOR) {
SERROR("Major/Minor mismatch, older Squashfs %d.%d filesystems "
@@ -58,6 +59,9 @@ static int supported_squashfs_filesystem(short major, short minor, int silent)
return 0;
}
+ if (compression != ZLIB_COMPRESSION)
+ return 0;
+
return 1;
}
@@ -125,9 +129,10 @@ static int squashfs_fill_super(struct super_block *s, void *data, int silent)
goto failed_mount;
}
- /* Check the MAJOR & MINOR versions */
+ /* Check the MAJOR & MINOR versions and compression type */
if (!supported_squashfs_filesystem(le16_to_cpu(sblk->s_major),
- le16_to_cpu(sblk->s_minor), silent))
+ le16_to_cpu(sblk->s_minor),
+ le16_to_cpu(sblk->compression), silent))
goto failed_mount;
/* Check the filesystem does not extend beyond the end of the
diff --git a/kernel/include/linux/squashfs_fs.h b/kernel/include/linux/squashfs_fs.h
index 50f3b98..aeb902f 100644
--- a/kernel/include/linux/squashfs_fs.h
+++ b/kernel/include/linux/squashfs_fs.h
@@ -215,7 +215,7 @@ struct meta_index {
/*
* definitions for structures on disk
*/
-#define COMPRESSION_ZLIB 1
+#define ZLIB_COMPRESSION 1
struct squashfs_super_block {
__le32 s_magic;