提交 d0db181c 编写于 作者: P Pavel Emelyanov 提交者: Jan Kara

udf: fix anchor point detection

According to ECMA 167 rev.  3 (see 3/8.4.2.1), Anchor Volume Descriptor
Pointer should be recorded at two or more anchor points located at sectors
256, N, N - 256, where N - is a largest logical sector number at volume
space.

So we should always try to detect N on UDF volume before trying to find
Anchor Volume Descriptor (i.e.  calling to udf_find_anchor()).

That said, all this patch does is updates the s_last_block even if the
udf_vrs() returns positive value.

Originally written and tested by Yuri Per, ported on latest mainline by me.
Signed-off-by: NYuri Per <Yuri.Per@acronis.com>
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Cc: Max Lyadvinsky <Max.Lyadvinsky@acronis.com>
Cc: Vladimir Simonov <Vladimir.Simonov@acronis.com>
Cc: Andrew Neporada <Andrew.Neporada@acronis.com>
Cc: Kirill Korotaev <dev@openvz.org>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 b80697c1
......@@ -1425,7 +1425,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
static int udf_check_valid(struct super_block *sb, int novrs, int silent)
{
long block;
struct udf_sb_info *sbi;
struct udf_sb_info *sbi = UDF_SB(sb);
if (novrs) {
udf_debug("Validity check skipped because of novrs option\n");
......@@ -1434,15 +1434,12 @@ static int udf_check_valid(struct super_block *sb, int novrs, int silent)
/* Check that it is NSR02 compliant */
/* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */
block = udf_vrs(sb, silent);
if (block != -1)
return !block;
sbi = UDF_SB(sb);
udf_debug("Failed to read byte 32768. Assuming open "
"disc. Skipping validity check\n");
if (!sbi->s_last_block)
if (block == -1)
udf_debug("Failed to read byte 32768. Assuming open "
"disc. Skipping validity check\n");
if (block && !sbi->s_last_block)
sbi->s_last_block = udf_get_last_block(sb);
return 0;
return !block;
}
static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册