diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-03-04 18:03:36 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2008-04-17 08:23:04 -0400 |
commit | d0db181c072259c21a375b290a4574e5ce6d2b5f (patch) | |
tree | 61cf137ac719c0ee229c6cc0d04c3f75d3f06ed6 /fs/udf/super.c | |
parent | b80697c14dcacd83ed1b78e26ad93b25ecc52c5e (diff) |
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: Yuri Per <Yuri.Per@acronis.com>
Signed-off-by: Pavel 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: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index bb8d866deb3f..137153c5005b 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -1425,7 +1425,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block, | |||
1425 | static int udf_check_valid(struct super_block *sb, int novrs, int silent) | 1425 | static int udf_check_valid(struct super_block *sb, int novrs, int silent) |
1426 | { | 1426 | { |
1427 | long block; | 1427 | long block; |
1428 | struct udf_sb_info *sbi; | 1428 | struct udf_sb_info *sbi = UDF_SB(sb); |
1429 | 1429 | ||
1430 | if (novrs) { | 1430 | if (novrs) { |
1431 | udf_debug("Validity check skipped because of novrs option\n"); | 1431 | 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) | |||
1434 | /* Check that it is NSR02 compliant */ | 1434 | /* Check that it is NSR02 compliant */ |
1435 | /* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */ | 1435 | /* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */ |
1436 | block = udf_vrs(sb, silent); | 1436 | block = udf_vrs(sb, silent); |
1437 | if (block != -1) | 1437 | if (block == -1) |
1438 | return !block; | 1438 | udf_debug("Failed to read byte 32768. Assuming open " |
1439 | 1439 | "disc. Skipping validity check\n"); | |
1440 | sbi = UDF_SB(sb); | 1440 | if (block && !sbi->s_last_block) |
1441 | udf_debug("Failed to read byte 32768. Assuming open " | ||
1442 | "disc. Skipping validity check\n"); | ||
1443 | if (!sbi->s_last_block) | ||
1444 | sbi->s_last_block = udf_get_last_block(sb); | 1441 | sbi->s_last_block = udf_get_last_block(sb); |
1445 | return 0; | 1442 | return !block; |
1446 | } | 1443 | } |
1447 | 1444 | ||
1448 | static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) | 1445 | static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) |