Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2439844pxp; Mon, 21 Mar 2022 20:31:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw73+GCQ/DjKnKjBaPrAGr8WKNBlysdgRWl5tkSj8oAWNqZ20OIIv2xYSdPEQcDJwH9BHIP X-Received: by 2002:a17:90b:1647:b0:1c7:510e:d0d3 with SMTP id il7-20020a17090b164700b001c7510ed0d3mr2605093pjb.10.1647919881219; Mon, 21 Mar 2022 20:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647919881; cv=none; d=google.com; s=arc-20160816; b=foAVc5yAQH0n4BB4e41P5vfUEvxZS3JaJpXs1m5DuLmDhEmlv6aMZeimzIodCOaXdt 5rSKF0HIFvle/7lGf9Z3Ln0OVkOBFF1jI/2TUYVM4Pcl4kJ1lUBjv/U/pwoiX8/UdRnC GNj+gle08A9JfX6GFJ2NwQt5dmrRHYC1Aehrlo4lFrTBTOcAtvb1SV67Jmv8E8eu5Jc1 kgePSbm7g4gctL3I2yJp2JAucc5QLxP7R7bEmW7wHuabk+FNJely+1kwHQU2Wb3268Oo v83Grp03h02285cqFHiXc898n4KRz726sjlBjCUnoAhMvfaWJbuhIZ6gq0DtrVtmRHKu jaxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=izgrYW0dHSoeWvjZ6IVbHy/HTeHGEPNtIyMKiIxw2j4=; b=nMP/IjPI7VxLUeexYzIeYmWr6cWo+9PFGU6UPTB51fPmaAj/9eTjuBW2dp76JVRIaM 2P3twjVufAaB9Pe38gta0qxqX95kyHCFGfdTtF46KV2SO6jMxoBG4QzpmokzrjGKRGFz jLLdn4jdNSnCPldmQhBsUZQai/6eYiKuvpMkfochokNbdaqiwU/sfB5VpYKpp62WY76S +GGrzVRKJFUR3nfYV9W7uYI9M+3UZ2Cx+P7cshK61WRCtqzwGfhFLha75UTOe874eMlj s3+/+VSZS3th9D0zi9bmTVUkPQXPpeY9FB0v2i//ButWo6cFX+md+nb5qndYssrw0SnJ JM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mT3VhGo0; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u14-20020a170902a60e00b00153bc4c0a7fsi12893714plq.593.2022.03.21.20.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 20:31:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mT3VhGo0; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C1FFA3C1C87; Mon, 21 Mar 2022 20:00:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235733AbiCVDCD (ORCPT + 99 others); Mon, 21 Mar 2022 23:02:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235761AbiCVDB7 (ORCPT ); Mon, 21 Mar 2022 23:01:59 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C163CC079 for ; Mon, 21 Mar 2022 20:00:33 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 25A7A1F41054 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1647918032; bh=Tx1VCof8d5xVQ2X1dQ+CXCV8k1m84bsTT2v1ZSmYgKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mT3VhGo0OF5Oje5JSQDFh9aLAuaR2yow24oQk1pUUyMeXaHREW9HzYr+kVs7zyoRP m8r00JXv8/J+1RCZRKiZJWRoDigsCneKVf1U7tw+TGytGjoO8p7A3LM0AzOYcSv0Vl LCbdgAkP/qX1m0wfWrUbNL2RyffdICIBQZAKxUQfmwzRT336Q1DeiXPEqBf1wGFE3q bFXETyhE2DjhzfGeiYxkymX5hxXjGSQY2QVDDQjiRPmpBCwjZ/HIoT3hHg+YGHslMo JHTUsqXwPjqdU5RK9CynA9Gx73UTQiapgWTxNODulHDfelRc5Z/B2rZ5/UkKr/y1L5 /aNt143Ng1yig== From: Gabriel Krisman Bertazi To: tytso@mit.edu Cc: ebiggers@kernel.org, jaegeuk@kernel.org, linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH 5/5] ext4: Log error when lookup of encoded dentry fails Date: Mon, 21 Mar 2022 23:00:04 -0400 Message-Id: <20220322030004.148560-6-krisman@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220322030004.148560-1-krisman@collabora.com> References: <20220322030004.148560-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If the volume is in strict mode, ext4_ci_compare can report a broken encoding name. This will not trigger on a bad lookup, which is caught earlier, only if the actual disk name is bad. Signed-off-by: Gabriel Krisman Bertazi --- fs/ext4/namei.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 8520115cd5c2..c321c6fdb4ae 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1456,6 +1456,9 @@ static bool ext4_match(struct inode *parent, * only case where it happens is on a disk * corruption or ENOMEM. */ + if (ret == -EINVAL) + EXT4_ERROR_INODE(parent, + "Bad encoded file in directory"); return false; } return ret; -- 2.35.1