Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1403625

Re: [PATCH 1/3] udf: Don't BUG on missing metadata partition descriptor

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] udf: Don't BUG on missing metadata partition descriptor
Date 2016-05-19 12:30 +0200
Message-ID <rAtnk-6Tf-17@gated-at.bofh.it> (permalink)
References <rAh2N-7md-7@gated-at.bofh.it> <rAh2N-7md-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 18-05-16 14:09:17, Alden Tondettar wrote:
> 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>

Thanks. I have added this patch to my tree.

								Honza

> ---
>  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
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] udf: Metadata partition fixes Alden Tondettar <alden.tondettar@gmail.com> - 2016-05-18 23:20 +0200
  [PATCH 0/3] udf: Metadata partition fixes Alden Tondettar <alden.tondettar@gmail.com> - 2016-05-18 23:20 +0200
  [PATCH 1/3] udf: Don't BUG on missing metadata partition descriptor Alden Tondettar <alden.tondettar@gmail.com> - 2016-05-18 23:20 +0200
    Re: [PATCH 1/3] udf: Don't BUG on missing metadata partition  descriptor Jan Kara <jack@suse.cz> - 2016-05-19 12:30 +0200
  [PATCH 3/3] udf: Use correct partition reference number for metadata Alden Tondettar <alden.tondettar@gmail.com> - 2016-05-18 23:20 +0200
    Re: [PATCH 3/3] udf: Use correct partition reference number for  metadata Jan Kara <jack@suse.cz> - 2016-05-19 13:10 +0200

csiph-web