]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: udf: Fix reporting UDF 2.60 revision
authorPali Rohár <pali.rohar@gmail.com>
Fri, 25 May 2018 15:52:31 +0000 (17:52 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Jul 2018 13:49:03 +0000 (15:49 +0200)
According to the UDF 2.60 specification, the Minimum UDF Read Revision
value shall be at most #0250 for all media with a UDF 2.60 file system.

So in this case use Minimum UDF Write Revision as ID_FS_VERSION to
distinguish between UDF 2.50 and UDF 2.60 discs.

This commit also adds a testing Blu-Ray Recordable image with UDF revision
2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
libblkid/src/superblocks/udf.c
tests/expected/blkid/low-probe-udf-bdr-2.60-nero [new file with mode: 0644]
tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz [new file with mode: 0644]

index bd8e0a5c2565f7d01588430b092436dc477fecf3..97e79dab0e4c35a5fd31d1715c2c015f5ada87f1 100644 (file)
@@ -446,6 +446,16 @@ real_blksz:
                        lvidiu_udf_rev = le16_to_cpu(lvidiu->min_udf_read_rev);
                        if (lvidiu_udf_rev)
                                udf_rev = lvidiu_udf_rev;
+                       /* UDF-2.60: 2. Basic Restrictions & Requirements:
+                        * The Minimum UDF Read Revision value shall be at most #0250
+                        * for all media with a UDF 2.60 file system.
+                        * So in this case use Minimum UDF Write Revision as ID_FS_VERSION
+                        * to distinguish between UDF 2.50 and UDF 2.60 discs. */
+                       if (lvidiu_udf_rev == 0x250) {
+                               lvidiu_udf_rev = le16_to_cpu(lvidiu->min_udf_write_rev);
+                               if (lvidiu_udf_rev > 0x250)
+                                       udf_rev = lvidiu_udf_rev;
+                       }
                }
        }
 
diff --git a/tests/expected/blkid/low-probe-udf-bdr-2.60-nero b/tests/expected/blkid/low-probe-udf-bdr-2.60-nero
new file mode 100644 (file)
index 0000000..c0b8867
--- /dev/null
@@ -0,0 +1,10 @@
+ID_FS_LABEL=Label
+ID_FS_LABEL_ENC=Label
+ID_FS_LOGICAL_VOLUME_ID=Label
+ID_FS_TYPE=udf
+ID_FS_USAGE=filesystem
+ID_FS_UUID=3b4a858dc4b57a72
+ID_FS_UUID_ENC=3b4a858dc4b57a72
+ID_FS_VERSION=2.60
+ID_FS_VOLUME_ID=Label
+ID_FS_VOLUME_SET_ID=3B4A858DC4B57A72
diff --git a/tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz b/tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz
new file mode 100644 (file)
index 0000000..9fb9a4f
Binary files /dev/null and b/tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz differ