]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: udf: Optimize and fix probing when block size > 2048 bytes
authorPali Rohár <pali.rohar@gmail.com>
Sun, 12 Nov 2017 20:55:21 +0000 (21:55 +0100)
committerPali Rohár <pali.rohar@gmail.com>
Sun, 12 Nov 2017 20:55:21 +0000 (21:55 +0100)
commitf5f269ece5a98f99a52e1dfa5e4d61fee83bf242
tree630e8ff8440a51c2d673c0cfa4dbd3dfddd36b5f
parent82524a1379c02bff0d061ffffae7398543218d33
libblkid: udf: Optimize and fix probing when block size > 2048 bytes

Optimize probing and detecting for UDF. Do not read and try to detect VRS
(Volume Recognition Sequence) on same blocks more times. For specific VSD
(Volume Structure Descriptor) length do it only once.

Fix probing of devices which has block size larger then 2048 bytes. It is
not truth that VSD is always 2048 bytes long. Its size is minimum of the
disk block size and 2048 bytes. See ECMA-167 sections 2/8.4 and 2/9.1.
Therefore when block size is larger then 2048 bytes, VRS needs to be
scanned again.

In commit 501aeb60a4914d8e4b273eb1529d70bc6ffaa077 was removed check for
empty VSD identifier because it caused that UDF image with block size of
the 4096 bytes was not detected. Reason was that VRS was improperly scanned
as VSD was 4096 bytes long, with 2048 bytes zero padding.

Now when processing of devices with block size larger then 2048 bytes is
fixed we can correctly stop scanning VRS at first invalid VSD as specified
in ECMA-167 section 2/8.3.1.
libblkid/src/superblocks/udf.c