From patchwork Wed May 18 21:09:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alden Tondettar X-Patchwork-Id: 9122451 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9AF3F9FB14 for ; Wed, 18 May 2016 21:12:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDF05202AE for ; Wed, 18 May 2016 21:12:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F08A4202EC for ; Wed, 18 May 2016 21:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754193AbcERVMb (ORCPT ); Wed, 18 May 2016 17:12:31 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:36575 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753589AbcERVM0 (ORCPT ); Wed, 18 May 2016 17:12:26 -0400 Received: by mail-pa0-f68.google.com with SMTP id xm6so5813356pab.3; Wed, 18 May 2016 14:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Wrs0G1cEudKUjXq3Pg4lpg7mP2QFPITC66J5vaikZKc=; b=WOTVMwFKoDSt3wu42ym2ix0eihMeMOvBVAkBNXDMcNA0wIW+uXXSQMwK2GRX40tZUz ohPmI0rNgceAaJQ+QrRqNKv2ulf8vWrx1jCYerWGGi74TUbkzT4mYwoTpywUsXZL/Zen oZ9u+KCjE4Q4+6AR7ByiVvDDseE1N2gCzLd6gJ0wPYdgb3EVUIeUk6qmOEEbThrlpHxP ZH8F5LjM/RDgBZEDbzode6yNkeOebbH5sHRtJlN9/NDC1F2Y3YPoypKYUbx2pvwGI7b9 MSejUehL+zDMw1Wx9E+rJkfPix7ftQj1oKwXMqFfqiaK/Ftcgmxv6rIpwtdjdaKhBqCb 1N+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Wrs0G1cEudKUjXq3Pg4lpg7mP2QFPITC66J5vaikZKc=; b=HGQ7iuMtPP3mKREa5EUJCh6Bs6nQjX58pByTnX9FQFveadFsyW6ojbaGzVENmD0QF0 5+4U/YeIl0DwR6vCu3WrpdSKDxie3OnktcZG510WCwq7JtB9g4ttr8MF7GqRLGoRxGwq Yivm//OYsuvAkkLcUhitAZPgaxmjb8d1Zhv+WYuUN3sLpMxY8XeXic7ZGE/3STGBUs7X dLYb2k1+UGIkXkTFFpJO7z97YHdRK6FRCIG4Wcl1L0fQjsaVhlfjZYUcrJWTwX8GYfye zioPrEN80VBdbiAG8oDlxXcCRz5Ruvzfv/8f5hS0ooJxN1IcKcgu37R+P8M7xCCn2NiK TRpw== X-Gm-Message-State: AOPr4FUMFnXMMkWVd1hqdMUBjdzGohP0caz34WmqmKCkUQGatNi1BlO0FPdQU5kkDtovHQ== X-Received: by 10.66.190.131 with SMTP id gq3mr13946915pac.42.1463605945146; Wed, 18 May 2016 14:12:25 -0700 (PDT) Received: from rincewind.rincewind (71.sub-75-211-163.myvzw.com. [75.211.163.71]) by smtp.gmail.com with ESMTPSA id az6sm14387898pab.43.2016.05.18.14.12.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 May 2016 14:12:24 -0700 (PDT) From: Alden Tondettar To: Jan Kara Cc: Laura Abbott , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alden Tondettar Subject: [PATCH 1/3] udf: Don't BUG on missing metadata partition descriptor Date: Wed, 18 May 2016 14:09:17 -0700 Message-Id: <1463605759-7616-3-git-send-email-alden.tondettar@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1463605759-7616-1-git-send-email-alden.tondettar@gmail.com> References: <1463605759-7616-1-git-send-email-alden.tondettar@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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");