提交 47c9358a 编写于 作者: S Sebastian Manciulea 提交者: Jan Kara

udf: Fix bug in VAT mapping code

Fix mapping of blocks using VAT when it is stored in an inode.
UDF_I(inode)->i_data already points to the beginning of VAT header so there's
no need to add udf_ext0_offset(inode).
Signed-off-by: NSebastian Manciulea <manciuleas@yahoo.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 bfb257a5
...@@ -66,7 +66,8 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, ...@@ -66,7 +66,8 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block,
} }
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
loc = le32_to_cpu(((__le32 *)iinfo->i_ext.i_data)[block]); loc = le32_to_cpu(((__le32 *)(iinfo->i_ext.i_data +
vdata->s_start_offset))[block]);
goto translate; goto translate;
} }
index = (sb->s_blocksize - vdata->s_start_offset) / sizeof(uint32_t); index = (sb->s_blocksize - vdata->s_start_offset) / sizeof(uint32_t);
......
...@@ -1215,8 +1215,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) ...@@ -1215,8 +1215,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
return 1; return 1;
if (map->s_partition_type == UDF_VIRTUAL_MAP15) { if (map->s_partition_type == UDF_VIRTUAL_MAP15) {
map->s_type_specific.s_virtual.s_start_offset = map->s_type_specific.s_virtual.s_start_offset = 0;
udf_ext0_offset(sbi->s_vat_inode);
map->s_type_specific.s_virtual.s_num_entries = map->s_type_specific.s_virtual.s_num_entries =
(sbi->s_vat_inode->i_size - 36) >> 2; (sbi->s_vat_inode->i_size - 36) >> 2;
} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) { } else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
...@@ -1233,8 +1232,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) ...@@ -1233,8 +1232,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
} }
map->s_type_specific.s_virtual.s_start_offset = map->s_type_specific.s_virtual.s_start_offset =
le16_to_cpu(vat20->lengthHeader) + le16_to_cpu(vat20->lengthHeader);
udf_ext0_offset(sbi->s_vat_inode);
map->s_type_specific.s_virtual.s_num_entries = map->s_type_specific.s_virtual.s_num_entries =
(sbi->s_vat_inode->i_size - (sbi->s_vat_inode->i_size -
map->s_type_specific.s_virtual. map->s_type_specific.s_virtual.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册