|
@@ -36,6 +36,7 @@
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <linux/magic.h>
|
|
#include <linux/magic.h>
|
|
|
|
+#include <linux/xattr.h>
|
|
|
|
|
|
#include "squashfs_fs.h"
|
|
#include "squashfs_fs.h"
|
|
#include "squashfs_fs_sb.h"
|
|
#include "squashfs_fs_sb.h"
|
|
@@ -82,7 +83,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
|
|
long long root_inode;
|
|
long long root_inode;
|
|
unsigned short flags;
|
|
unsigned short flags;
|
|
unsigned int fragments;
|
|
unsigned int fragments;
|
|
- u64 lookup_table_start;
|
|
|
|
|
|
+ u64 lookup_table_start, xattr_id_table_start;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
TRACE("Entered squashfs_fill_superblock\n");
|
|
TRACE("Entered squashfs_fill_superblock\n");
|
|
@@ -143,7 +144,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
|
|
* Check if there's xattrs in the filesystem. These are not
|
|
* Check if there's xattrs in the filesystem. These are not
|
|
* supported in this version, so warn that they will be ignored.
|
|
* supported in this version, so warn that they will be ignored.
|
|
*/
|
|
*/
|
|
- if (le64_to_cpu(sblk->xattr_table_start) != SQUASHFS_INVALID_BLK)
|
|
|
|
|
|
+ if (le64_to_cpu(sblk->xattr_id_table_start) != SQUASHFS_INVALID_BLK)
|
|
ERROR("Xattrs in filesystem, these will be ignored\n");
|
|
ERROR("Xattrs in filesystem, these will be ignored\n");
|
|
|
|
|
|
/* Check the filesystem does not extend beyond the end of the
|
|
/* Check the filesystem does not extend beyond the end of the
|
|
@@ -253,7 +254,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
|
|
allocate_lookup_table:
|
|
allocate_lookup_table:
|
|
lookup_table_start = le64_to_cpu(sblk->lookup_table_start);
|
|
lookup_table_start = le64_to_cpu(sblk->lookup_table_start);
|
|
if (lookup_table_start == SQUASHFS_INVALID_BLK)
|
|
if (lookup_table_start == SQUASHFS_INVALID_BLK)
|
|
- goto allocate_root;
|
|
|
|
|
|
+ goto allocate_xattr_table;
|
|
|
|
|
|
/* Allocate and read inode lookup table */
|
|
/* Allocate and read inode lookup table */
|
|
msblk->inode_lookup_table = squashfs_read_inode_lookup_table(sb,
|
|
msblk->inode_lookup_table = squashfs_read_inode_lookup_table(sb,
|
|
@@ -266,6 +267,19 @@ allocate_lookup_table:
|
|
|
|
|
|
sb->s_export_op = &squashfs_export_ops;
|
|
sb->s_export_op = &squashfs_export_ops;
|
|
|
|
|
|
|
|
+allocate_xattr_table:
|
|
|
|
+ xattr_id_table_start = le64_to_cpu(sblk->xattr_id_table_start);
|
|
|
|
+ if (xattr_id_table_start == SQUASHFS_INVALID_BLK)
|
|
|
|
+ goto allocate_root;
|
|
|
|
+
|
|
|
|
+ /* Allocate and read xattr id lookup table */
|
|
|
|
+ msblk->xattr_id_table = squashfs_read_xattr_id_table(sb,
|
|
|
|
+ xattr_id_table_start, &msblk->xattr_table, &msblk->xattr_ids);
|
|
|
|
+ if (IS_ERR(msblk->xattr_id_table)) {
|
|
|
|
+ err = PTR_ERR(msblk->xattr_id_table);
|
|
|
|
+ msblk->xattr_id_table = NULL;
|
|
|
|
+ goto failed_mount;
|
|
|
|
+ }
|
|
allocate_root:
|
|
allocate_root:
|
|
root = new_inode(sb);
|
|
root = new_inode(sb);
|
|
if (!root) {
|
|
if (!root) {
|
|
@@ -301,6 +315,7 @@ failed_mount:
|
|
kfree(msblk->inode_lookup_table);
|
|
kfree(msblk->inode_lookup_table);
|
|
kfree(msblk->fragment_index);
|
|
kfree(msblk->fragment_index);
|
|
kfree(msblk->id_table);
|
|
kfree(msblk->id_table);
|
|
|
|
+ kfree(msblk->xattr_id_table);
|
|
kfree(sb->s_fs_info);
|
|
kfree(sb->s_fs_info);
|
|
sb->s_fs_info = NULL;
|
|
sb->s_fs_info = NULL;
|
|
kfree(sblk);
|
|
kfree(sblk);
|
|
@@ -355,6 +370,7 @@ static void squashfs_put_super(struct super_block *sb)
|
|
kfree(sbi->fragment_index);
|
|
kfree(sbi->fragment_index);
|
|
kfree(sbi->meta_index);
|
|
kfree(sbi->meta_index);
|
|
kfree(sbi->inode_lookup_table);
|
|
kfree(sbi->inode_lookup_table);
|
|
|
|
+ kfree(sbi->xattr_id_table);
|
|
kfree(sb->s_fs_info);
|
|
kfree(sb->s_fs_info);
|
|
sb->s_fs_info = NULL;
|
|
sb->s_fs_info = NULL;
|
|
}
|
|
}
|