]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/PartitionDxe: Fix UDF fs access on certain CD/DVD medias
authorPaulo Alcantara <pcacjr@zytor.com>
Fri, 13 Oct 2017 13:24:49 +0000 (21:24 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 15 Nov 2017 12:43:42 +0000 (20:43 +0800)
commit1fbe8276c4031004df8b0516bc038d10f2037dcc
tree313684c84fd4deba2ae09385a4b273ad66bdbb97
parenta7f3ed1f5276d1dd512449288f66581d44b42745
MdeModulePkg/PartitionDxe: Fix UDF fs access on certain CD/DVD medias

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=725

Historically many drives or medias do not correctly return their value
for block N - which is also referred as last addressable/recorded block.
When they do so, there is still a problem when relying on last recorded
block number returned by SCSI commands READ CAPACITY and READ TRACK
INFORMATION - that is, between block 0 and block N there may be
unwritten blocks which are located outside any track.

That said, the Partition driver was unable to find AVDP at block N on
certain medias that do not either return or report their last recorded
block number correctly.

Apparently there is no official or correct way to find the correct block
number, however tools like the Philips UDF Conformance Tool (udf_test)
apply a correction by searching for an AVDP or VAT in blocks N through
N-456 -- this can be observed by looking at the log reported by udf_test
on those CD/DVD medias. So, if the AVDP or VAT is found, then it sets
the last recorded block number to where AVDP or VAT was located.

With the below setence in UDF 2.60, 6.13.2.2 Background Physical
Formatting:

"... the second AVDP must be recorded after the Background physical
Formatting has been finished..."

Implies that the last recorded block is the one where second AVDP was
recorded.

This patch implements a similar way to correct the last recorded block
number by searching for last AVDP in blocks N-1 through N-512 on those
certain medias, as well as ensure a minimum number of 2 AVDPs found as
specified by ECMA 167 and UDF 2.60 specifications.

Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Reported-by: Hao Wu <hao.a.wu@intel.com>
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c