--- zzzz-none-000/linux-2.6.39.4/fs/squashfs/namei.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/fs/squashfs/namei.c 2021-11-10 13:23:10.000000000 +0000 @@ -102,7 +102,7 @@ break; - size = le32_to_cpu(index->size) + 1; + size = sqsh32_to_cpu(index->size) + 1; err = squashfs_read_metadata(sb, index->name, &index_start, &index_offset, size); @@ -114,8 +114,8 @@ if (strcmp(index->name, str) > 0) break; - length = le32_to_cpu(index->index); - *next_block = le32_to_cpu(index->start_block) + + length = sqsh32_to_cpu(index->index); + *next_block = sqsh32_to_cpu(index->start_block) + msblk->directory_table; } @@ -175,7 +175,7 @@ length += sizeof(dirh); - dir_count = le32_to_cpu(dirh.count) + 1; + dir_count = sqsh32_to_cpu(dirh.count) + 1; /* dir_count should never be larger than 256 */ if (dir_count > 256) @@ -190,7 +190,7 @@ if (err < 0) goto read_failure; - size = le16_to_cpu(dire->size) + 1; + size = sqsh16_to_cpu(dire->size) + 1; /* size should never be larger than SQUASHFS_NAME_LEN */ if (size > SQUASHFS_NAME_LEN) @@ -209,10 +209,10 @@ if (len == size && !strncmp(name, dire->name, len)) { unsigned int blk, off, ino_num; long long ino; - blk = le32_to_cpu(dirh.start_block); - off = le16_to_cpu(dire->offset); - ino_num = le32_to_cpu(dirh.inode_number) + - (short) le16_to_cpu(dire->inode_number); + blk = sqsh32_to_cpu(dirh.start_block); + off = sqsh16_to_cpu(dire->offset); + ino_num = sqsh32_to_cpu(dirh.inode_number) + + (short) sqsh16_to_cpu(dire->inode_number); ino = SQUASHFS_MKINODE(blk, off); TRACE("calling squashfs_iget for directory "