diff options
author | Sebastian Manciulea <manciuleas@yahoo.com> | 2008-04-14 11:06:36 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2008-04-17 08:29:43 -0400 |
commit | 47c9358a015199ed37c66235a2238271a7c8041f (patch) | |
tree | 265659628f44c00a65a0deaee6edc137aed6cab1 /fs | |
parent | bfb257a5981af805a9394f00f75d3d9f7b611cc0 (diff) |
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: Sebastian Manciulea <manciuleas@yahoo.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/udf/partition.c | 3 | ||||
-rw-r--r-- | fs/udf/super.c | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/fs/udf/partition.c b/fs/udf/partition.c index 2dfe4be2eeb2..63610f026ae1 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c | |||
@@ -66,7 +66,8 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, | |||
66 | } | 66 | } |
67 | 67 | ||
68 | if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { | 68 | if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { |
69 | loc = le32_to_cpu(((__le32 *)iinfo->i_ext.i_data)[block]); | 69 | loc = le32_to_cpu(((__le32 *)(iinfo->i_ext.i_data + |
70 | vdata->s_start_offset))[block]); | ||
70 | goto translate; | 71 | goto translate; |
71 | } | 72 | } |
72 | index = (sb->s_blocksize - vdata->s_start_offset) / sizeof(uint32_t); | 73 | index = (sb->s_blocksize - vdata->s_start_offset) / sizeof(uint32_t); |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 29b19678327a..8f02b30c22ef 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -1215,8 +1215,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index) | |||
1215 | return 1; | 1215 | return 1; |
1216 | 1216 | ||
1217 | if (map->s_partition_type == UDF_VIRTUAL_MAP15) { | 1217 | if (map->s_partition_type == UDF_VIRTUAL_MAP15) { |
1218 | map->s_type_specific.s_virtual.s_start_offset = | 1218 | map->s_type_specific.s_virtual.s_start_offset = 0; |
1219 | udf_ext0_offset(sbi->s_vat_inode); | ||
1220 | map->s_type_specific.s_virtual.s_num_entries = | 1219 | map->s_type_specific.s_virtual.s_num_entries = |
1221 | (sbi->s_vat_inode->i_size - 36) >> 2; | 1220 | (sbi->s_vat_inode->i_size - 36) >> 2; |
1222 | } else if (map->s_partition_type == UDF_VIRTUAL_MAP20) { | 1221 | } 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 | } | 1232 | } |
1234 | 1233 | ||
1235 | map->s_type_specific.s_virtual.s_start_offset = | 1234 | map->s_type_specific.s_virtual.s_start_offset = |
1236 | le16_to_cpu(vat20->lengthHeader) + | 1235 | le16_to_cpu(vat20->lengthHeader); |
1237 | udf_ext0_offset(sbi->s_vat_inode); | ||
1238 | map->s_type_specific.s_virtual.s_num_entries = | 1236 | map->s_type_specific.s_virtual.s_num_entries = |
1239 | (sbi->s_vat_inode->i_size - | 1237 | (sbi->s_vat_inode->i_size - |
1240 | map->s_type_specific.s_virtual. | 1238 | map->s_type_specific.s_virtual. |