Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8740DC433F5 for ; Thu, 19 May 2022 20:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244791AbiESUrR (ORCPT ); Thu, 19 May 2022 16:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244784AbiESUrN (ORCPT ); Thu, 19 May 2022 16:47:13 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12EB9326D2 for ; Thu, 19 May 2022 13:47:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id BA7EF1F4541F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652993231; bh=M0TLs16gnY6Il6I/gjDxltCLo80eOfsQXUv+A05frpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OKmOKKuBiKoZUWrPq5KGfLwDltQMzOtgH7697UjH8TlhKWXb2ZyBiHoObI3NbS9iN 58fV6Woayp8DGzdMl9r6Wp+E+gwMdf9kDe1Y23w3XkH9zlSA2sRtB1yd4VQVyZj4fF wyZqRdkvyz25s+WwMWTwIjCbxdiPjoO76V+LekH0Xy4yVdCE/VnD1FUpk4lkenGGJf PiUR/4V5WQ3b+J46f2wfrZVuK/tofuUdW77NURr8GmT4zy0W5eixq9ksVqlcAKjJu3 JLTFg8oKvs4BzDLczc4Fd6xV1yPt1jN2980GmMBO6MG7JDs35nzoZEE87gpS54MmWh 1DFFwS5xgSO+g== From: Gabriel Krisman Bertazi To: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, ebiggers@kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Gabriel Krisman Bertazi , kernel@collabora.com, Eric Biggers Subject: [PATCH v7 6/8] ext4: Log error when lookup of encoded dentry fails Date: Thu, 19 May 2022 16:46:43 -0400 Message-Id: <20220519204645.16528-7-krisman@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220519204645.16528-1-krisman@collabora.com> References: <20220519204645.16528-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Eric Biggers Signed-off-by: Gabriel Krisman Bertazi --- changes since v4: - Reword error message (Eric) Changes since v1: - reword error message "file in directory" -> "filename" (Eric) --- fs/ext4/namei.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 5e68dd6ad9b8..f4593dc3e593 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1406,6 +1406,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, + "Directory contains filename that is invalid UTF-8"); return false; } return ret; -- 2.36.1