summaryrefslogtreecommitdiffstats
path: root/fs/udf/partition.c
diff options
context:
space:
mode:
authorAlden Tondettar <alden.tondettar@gmail.com>2016-05-18 23:09:17 +0200
committerJan Kara <jack@suse.cz>2016-05-19 11:55:53 +0200
commit585d70006f6e30f42e96d56c6c0933671c516c7b (patch)
tree07531d00ad87220b8f049b1b4abf75ece7a22929 /fs/udf/partition.c
parentMerge tag 'trace-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/roste... (diff)
downloadlinux-585d70006f6e30f42e96d56c6c0933671c516c7b.tar.xz
linux-585d70006f6e30f42e96d56c6c0933671c516c7b.zip
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>
Diffstat (limited to 'fs/udf/partition.c')
-rw-r--r--fs/udf/partition.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index 5f861ed287c3..e4e9e70c37f2 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -317,8 +317,9 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
mdata = &map->s_type_specific.s_metadata;
inode = mdata->s_metadata_fe ? : mdata->s_mirror_fe;
- /* We shouldn't mount such media... */
- BUG_ON(!inode);
+ if (!inode)
+ return 0xFFFFFFFF;
+
retblk = udf_try_read_meta(inode, block, partition, offset);
if (retblk == 0xFFFFFFFF && mdata->s_metadata_fe) {
udf_warn(sb, "error reading from METADATA, trying to read from MIRROR\n");