summaryrefslogtreecommitdiff
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-01-18 16:08:10 +0300
committerJan Kara <jack@suse.cz>2023-01-26 18:46:33 +0300
commit08931b78932d56185753af77b93b8dcaace31e04 (patch)
tree16a8137255bcbc3d976018d6cda76c57ffc64d63 /fs/udf
parent4215db46d5389066bba103f87d6fb4aa392ec849 (diff)
downloadlinux-08931b78932d56185753af77b93b8dcaace31e04.tar.xz
udf: Use udf_bread() in udf_load_vat()
Use udf_bread() instead of mapping and loadign buffer head manually in udf_load_vat(). Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 58a3148173ac..df5287c5d659 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1176,7 +1176,6 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
struct udf_part_map *map = &sbi->s_partmaps[p_index];
struct buffer_head *bh = NULL;
struct udf_inode_info *vati;
- uint32_t pos;
struct virtualAllocationTable20 *vat20;
sector_t blocks = sb_bdev_nr_blocks(sb);
@@ -1198,10 +1197,14 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
vati = UDF_I(sbi->s_vat_inode);
if (vati->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
- pos = udf_block_map(sbi->s_vat_inode, 0);
- bh = sb_bread(sb, pos);
- if (!bh)
- return -EIO;
+ int err = 0;
+
+ bh = udf_bread(sbi->s_vat_inode, 0, 0, &err);
+ if (!bh) {
+ if (!err)
+ err = -EFSCORRUPTED;
+ return err;
+ }
vat20 = (struct virtualAllocationTable20 *)bh->b_data;
} else {
vat20 = (struct virtualAllocationTable20 *)