From 67621675e9636ed272a4f0235215accdfbc99768 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 8 Feb 2018 18:10:54 +0100 Subject: udf: Allow volume descriptor sequence to be terminated by unrecorded block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to ECMA-167 3/8.4.2 a volume descriptor sequence can be terminated also by an unrecorded block within the extent of volume descriptor sequence. Currently we errored out in such case making such volumes unmountable. Handle that case by treating any invalid block as a block terminating the sequence. Reported-by: Pali Rohár Acked-by: Pali Rohár Signed-off-by: Jan Kara --- fs/udf/super.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'fs/udf/super.c') diff --git a/fs/udf/super.c b/fs/udf/super.c index f80b97173acd..456d737fc7ca 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1627,12 +1627,8 @@ static noinline int udf_process_sequence( for (; (!done && block <= lastblock); block++) { bh = udf_read_tagged(sb, block, block, &ident); - if (!bh) { - udf_err(sb, - "Block %llu of volume descriptor sequence is corrupted or we could not read it\n", - (unsigned long long)block); - return -EAGAIN; - } + if (!bh) + break; /* Process each descriptor (ISO 13346 3/8.3-8.4) */ gd = (struct generic_desc *)bh->b_data; -- cgit v1.2.3