From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932251AbcESKZi (ORCPT ); Thu, 19 May 2016 06:25:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:33560 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753970AbcESKZh (ORCPT ); Thu, 19 May 2016 06:25:37 -0400 Date: Thu, 19 May 2016 12:25:33 +0200 From: Jan Kara To: Alden Tondettar Cc: Jan Kara , Laura Abbott , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] udf: Don't BUG on missing metadata partition descriptor Message-ID: <20160519102533.GA8839@quack2.suse.cz> References: <1463605759-7616-1-git-send-email-alden.tondettar@gmail.com> <1463605759-7616-3-git-send-email-alden.tondettar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463605759-7616-3-git-send-email-alden.tondettar@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 SUSE Labs, CR