From patchwork Wed May 18 21:09:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alden Tondettar X-Patchwork-Id: 9122461 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 1AEB89F37F for ; Wed, 18 May 2016 21:13:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49964202EC for ; Wed, 18 May 2016 21:13:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63CB2202AE for ; Wed, 18 May 2016 21:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754174AbcERVMa (ORCPT ); Wed, 18 May 2016 17:12:30 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35303 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753863AbcERVM2 (ORCPT ); Wed, 18 May 2016 17:12:28 -0400 Received: by mail-pf0-f196.google.com with SMTP id b66so6020739pfb.2; Wed, 18 May 2016 14:12:27 -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=N2Tbh7oaI38IpeBFGFhCnT1wbjVAvQHHx5zkwXh/cyY=; b=AB2AQ/0wzG02/UP5l9vOvNGOj9MWDAH4CA/UXCWFNCEGbtnY6pYX02Uwp2WqLKoTkf B1lv4/nUUboD+qci2QDOsOtHPO7RqY2u0C+8MF51TV6sbcVQvPJZXW7C4YUcCnf6L4pK DoHMjCNW17r2YvhCkflNDKGsEUvJQB8ywWaVCvgjf+Vz78Y9d6aF7NXAgKfgqXvjKRmd jIFdJSSZwXfAPqN9FZes4CmdY7Qq5ECuvLLtYxuB4lbad9216FGj9d1aZIKezM1nPJv8 dlBkFjziGyzPt9pIiuwB/8jlXhsFdM2SfQAXUsSCN/dJJtlzseqyRepFVPfAe9t7Saam 17Ew== 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=N2Tbh7oaI38IpeBFGFhCnT1wbjVAvQHHx5zkwXh/cyY=; b=hnI9y+rczKJvzTimPCEI9hI75/5pJPs2rfEPblmXpe4jfbuISETp+kRSCY3/d1zqoy H9U9pgBfSBfdE47sBooLPH6S7I6y52hnOYncoqwa5PCsC9oFXVkM/tNr/JMqcPRWpDNN psHKUQX3eeiZWVbfNWfkT56yqJXQzErOA6RP933EDyKxsSsDp/4k3v9Pa8SR5BrdUCQa 5a+IZ0JqjRldkDbnaS5lMy8kB6dUfhpjOZry9IahZ3h4AaGjfeST7xaha6QDFZtxYS+H 8Hxtp56BwfW8k4QUxUdk6/ULAbUexgSq+4m6Gtm5GG/ZpC+ths86OUzKVlSh2PFcXQAE brBw== X-Gm-Message-State: AOPr4FXpJuQmXqwtUxr412R3aEenyvvv9xUZ0D/47dEx0IM85bhTXs8YKL5QMvqoFrnUxA== X-Received: by 10.98.18.80 with SMTP id a77mr13914470pfj.27.1463605947457; Wed, 18 May 2016 14:12:27 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 May 2016 14:12:26 -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 2/3] udf: Use IS_ERR when loading metadata mirror file entry Date: Wed, 18 May 2016 14:09:18 -0700 Message-Id: <1463605759-7616-4-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 when udf_get_pblock_meta25() fails to map a block using the primary metadata file, it will attempt to load the mirror file entry by calling udf_find_metadata_inode_efe(). That function will return a ERR_PTR if it fails, but the return value is only checked against NULL. Test the return value using IS_ERR() and change it to NULL if needed. Signed-off-by: Alden Tondettar --- fs/udf/partition.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/udf/partition.c b/fs/udf/partition.c index e4e9e70..ca3cde3 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c @@ -326,6 +326,8 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block, if (!(mdata->s_flags & MF_MIRROR_FE_LOADED)) { mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, map->s_partition_num); + if (IS_ERR(mdata->s_mirror_fe)) + mdata->s_mirror_fe = NULL; mdata->s_flags |= MF_MIRROR_FE_LOADED; }