Skip to content

Commit 585d700

Browse files
Alden Tondettarjankara
authored andcommitted
udf: Don't BUG on missing metadata partition descriptor
Currently, if a metadata partition map is missing its partition descriptor, then udf_get_pblock_meta25() will BUG() out the first time it is called. This is rather drastic for a corrupted filesystem, so just treat this case as an invalid mapping instead. Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 2600a46 commit 585d700

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/udf/partition.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,9 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
317317
mdata = &map->s_type_specific.s_metadata;
318318
inode = mdata->s_metadata_fe ? : mdata->s_mirror_fe;
319319

320-
/* We shouldn't mount such media... */
321-
BUG_ON(!inode);
320+
if (!inode)
321+
return 0xFFFFFFFF;
322+
322323
retblk = udf_try_read_meta(inode, block, partition, offset);
323324
if (retblk == 0xFFFFFFFF && mdata->s_metadata_fe) {
324325
udf_warn(sb, "error reading from METADATA, trying to read from MIRROR\n");

0 commit comments

Comments
 (0)