diff options
author | Namjae Jeon <linkinjeon@gmail.com> | 2011-10-23 19:28:32 +0900 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-10-31 23:49:30 +0100 |
commit | 3080a74ea39eece6ac21aae768c48ab8b1f89ac1 (patch) | |
tree | c78cfad4ca9387b11bb7cef7b050c475ca25f592 /fs/udf/partition.c | |
parent | 6360e21f943172bb71772ec150b96a9e787a535f (diff) | |
download | lwn-3080a74ea39eece6ac21aae768c48ab8b1f89ac1.tar.gz lwn-3080a74ea39eece6ac21aae768c48ab8b1f89ac1.zip |
udf: Skip mirror metadata FE loading when metadata FE is ok
It is not necessary to load mirror metadata FE when metadata FE is OK. So try
to read it only the first time udf_get_pblock_meta25() fails to map the block
from metadata FE.
Signed-off-by: Ashish Sangwan <ashishsangwan2@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/partition.c')
-rw-r--r-- | fs/udf/partition.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/udf/partition.c b/fs/udf/partition.c index f3e472c67709..b526f25c04c9 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c @@ -321,8 +321,14 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block, /* We shouldn't mount such media... */ BUG_ON(!inode); retblk = udf_try_read_meta(inode, block, partition, offset); - if (retblk == 0xFFFFFFFF) { + if (retblk == 0xFFFFFFFF && mdata->s_metadata_fe) { udf_warn(sb, "error reading from METADATA, trying to read from MIRROR\n"); + if (!mdata->s_mirror_loaded_flag) { + mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb, + mdata->s_mirror_file_loc, map->s_partition_num); + mdata->s_mirror_loaded_flag = 1; + } + inode = mdata->s_mirror_fe; if (!inode) return 0xFFFFFFFF; |