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 <[EMAIL PROTECTED]>
Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
Cc: Max Lyadvinsky <[EMAIL PROTECTED]>
Cc: Vladimir Simonov <[EMAIL PROTECTED]>
Cc: Andrew Neporada <[EMAIL PROTECTED]>
Cc: Kirill Korotaev <[EMAIL PROTECTED]>

---

diff --git a/fs/udf/super.c b/fs/udf/super.c
index f3ac4ab..abd5e30 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1486,16 +1486,17 @@ 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) */
        else {
+               struct udf_sb_info *sbi = UDF_SB(sb);
+
                block = udf_vrs(sb, silent);
-               if (block == -1) {
-                       struct udf_sb_info *sbi = UDF_SB(sb);
+               if (block == -1)
                        udf_debug("Failed to read byte 32768. Assuming open "
                                  "disc. Skipping validity check\n");
-                       if (!sbi->s_last_block)
-                               sbi->s_last_block = udf_get_last_block(sb);
-                       return 0;
-               } else
-                       return !block;
+
+               if (block && !sbi->s_last_block)
+                       sbi->s_last_block = udf_get_last_block(sb);
+
+               return !block;
        }
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to