@@ -214,6 +214,24 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
214214 goto failed_mount ;
215215 }
216216
217+ /* Handle xattrs */
218+ sb -> s_xattr = squashfs_xattr_handlers ;
219+ xattr_id_table_start = le64_to_cpu (sblk -> xattr_id_table_start );
220+ if (xattr_id_table_start == SQUASHFS_INVALID_BLK )
221+ goto allocate_id_index_table ;
222+
223+ /* Allocate and read xattr id lookup table */
224+ msblk -> xattr_id_table = squashfs_read_xattr_id_table (sb ,
225+ xattr_id_table_start , & msblk -> xattr_table , & msblk -> xattr_ids );
226+ if (IS_ERR (msblk -> xattr_id_table )) {
227+ ERROR ("unable to read xattr id index table\n" );
228+ err = PTR_ERR (msblk -> xattr_id_table );
229+ msblk -> xattr_id_table = NULL ;
230+ if (err != - ENOTSUPP )
231+ goto failed_mount ;
232+ }
233+
234+ allocate_id_index_table :
217235 /* Allocate and read id index table */
218236 msblk -> id_table = squashfs_read_id_index_table (sb ,
219237 le64_to_cpu (sblk -> id_table_start ), le16_to_cpu (sblk -> no_ids ));
@@ -224,9 +242,27 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
224242 goto failed_mount ;
225243 }
226244
245+ /* Handle inode lookup table */
246+ lookup_table_start = le64_to_cpu (sblk -> lookup_table_start );
247+ if (lookup_table_start == SQUASHFS_INVALID_BLK )
248+ goto handle_fragments ;
249+
250+ /* Allocate and read inode lookup table */
251+ msblk -> inode_lookup_table = squashfs_read_inode_lookup_table (sb ,
252+ lookup_table_start , msblk -> inodes );
253+ if (IS_ERR (msblk -> inode_lookup_table )) {
254+ ERROR ("unable to read inode lookup table\n" );
255+ err = PTR_ERR (msblk -> inode_lookup_table );
256+ msblk -> inode_lookup_table = NULL ;
257+ goto failed_mount ;
258+ }
259+
260+ sb -> s_export_op = & squashfs_export_ops ;
261+
262+ handle_fragments :
227263 fragments = le32_to_cpu (sblk -> fragments );
228264 if (fragments == 0 )
229- goto allocate_lookup_table ;
265+ goto allocate_root ;
230266
231267 msblk -> fragment_cache = squashfs_cache_init ("fragment" ,
232268 SQUASHFS_CACHED_FRAGMENTS , msblk -> block_size );
@@ -245,39 +281,6 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
245281 goto failed_mount ;
246282 }
247283
248- allocate_lookup_table :
249- lookup_table_start = le64_to_cpu (sblk -> lookup_table_start );
250- if (lookup_table_start == SQUASHFS_INVALID_BLK )
251- goto allocate_xattr_table ;
252-
253- /* Allocate and read inode lookup table */
254- msblk -> inode_lookup_table = squashfs_read_inode_lookup_table (sb ,
255- lookup_table_start , msblk -> inodes );
256- if (IS_ERR (msblk -> inode_lookup_table )) {
257- ERROR ("unable to read inode lookup table\n" );
258- err = PTR_ERR (msblk -> inode_lookup_table );
259- msblk -> inode_lookup_table = NULL ;
260- goto failed_mount ;
261- }
262-
263- sb -> s_export_op = & squashfs_export_ops ;
264-
265- allocate_xattr_table :
266- sb -> s_xattr = squashfs_xattr_handlers ;
267- xattr_id_table_start = le64_to_cpu (sblk -> xattr_id_table_start );
268- if (xattr_id_table_start == SQUASHFS_INVALID_BLK )
269- goto allocate_root ;
270-
271- /* Allocate and read xattr id lookup table */
272- msblk -> xattr_id_table = squashfs_read_xattr_id_table (sb ,
273- xattr_id_table_start , & msblk -> xattr_table , & msblk -> xattr_ids );
274- if (IS_ERR (msblk -> xattr_id_table )) {
275- ERROR ("unable to read xattr id index table\n" );
276- err = PTR_ERR (msblk -> xattr_id_table );
277- msblk -> xattr_id_table = NULL ;
278- if (err != - ENOTSUPP )
279- goto failed_mount ;
280- }
281284allocate_root :
282285 root = new_inode (sb );
283286 if (!root ) {
0 commit comments