[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1463605759-7616-3-git-send-email-alden.tondettar@gmail.com>
Date: Wed, 18 May 2016 14:09:17 -0700
From: Alden Tondettar <alden.tondettar@...il.com>
To: Jan Kara <jack@...e.com>
Cc: Laura Abbott <labbott@...oraproject.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Alden Tondettar <alden.tondettar@...il.com>
Subject: [PATCH 1/3] 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@...il.com>
---
fs/udf/partition.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index 5f861ed2..e4e9e70 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");
--
2.1.4
Powered by blists - more mailing lists