From patchwork Thu Feb 8 08:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 198206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp24834dyd; Thu, 8 Feb 2024 00:35:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzLM+2CIw+LsQM7yY9+4o6RN+nqDonrewx7KatrgX2Ird7kAs0ZjwiBfO2n8jCJxkD0jMU X-Received: by 2002:a05:6214:400a:b0:68c:c017:522e with SMTP id kd10-20020a056214400a00b0068cc017522emr3391555qvb.1.1707381349944; Thu, 08 Feb 2024 00:35:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707381349; cv=pass; d=google.com; s=arc-20160816; b=wg+V9l2XiQulTMczUrCqAg+6ZUZc+k+Z/Y0Wtxih7JzOvzV0qEU2QrEvW+KpztkVht 0ZNpBMgUG9CLr0pOfwGYTDnGrIWVFt7p1rwIq16ljibU4Zt0oCY6NxmdR/rwja55pTmv 7hsIq50h5bMnsjv6t/XBpOqBst53xIlQFDlUa2mPb5w/vhbWYNYlZu3QucgB7oBquVqg mkIf+XhZNa1MICNaIwA90n2UzyW/bZXTdUdqM71Qt44QKYP/GCYJXr1JwS0NwZRq9b8O nt62bIERhu+SAYwmU2TUuIKpStAWPb+uIax1Dm0do3FxEEJhaaL1h5yspo+S58pUvtPN OwRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=8+Ky6txoPS9NM6QFdT3YQarxsfrgCHiaEb2s2Ck0KtI=; fh=0chjQ3EjkyODMxF72Etrzx8CtVbJecIxrZO5wLNx7DM=; b=FlbuqkFIqo6pfWEH+46w+G7clrdmeH6+k0bZP+cO0hyTImOcc/27VwXklL9vD/URIO HGf8Q2DToHt7sK2WQrsoxSkexRDzh+pLGmSIPWM8mjUIJRR+w82YRuUISOcRxr6yMXRc CzDbOMmyaWwxWrhfgpDoX8zOuFePWnr2g5+AxWS9Q1svPWi2vviDJDtBjXu8PvNv3HpD RAn+OnfW77vXO3uW95Oh6DwWE2WbsQqu2RU9swlDeBtGj9ek9cz6qeQI5Iiscby+UXuX QMzKpsuRGop1Jwh+KZCXv/kPQj0Iwam4Nd56CGCNtdiB3tpjgwClLJ++RQqp5xoii9Kr zYxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=3plkq6QD; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-57622-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57622-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCUG4MrxgX19SXekLBBbTRVW9Q7TdSRmvFUtWxkPwFCTxmlhVlDRE+7VS4otrP0W2lNfh0c1OH1S/B1Xc4Ptl4MHHA1Tbg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t18-20020a056214155200b0068c8a2800b9si2777834qvw.422.2024.02.08.00.35.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 00:35:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57622-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=3plkq6QD; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-57622-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57622-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B66DF1C23CC6 for ; Thu, 8 Feb 2024 08:35:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1821C6A8BF; Thu, 8 Feb 2024 08:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="3plkq6QD" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADB526A348; Thu, 8 Feb 2024 08:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707381330; cv=none; b=bx93e7qKm2k3kl4x0ddv10n1zelCM8Z60uglYz46wRxIyQO/gZlnVGyL0VhmtxsB4v8nEnIkCO/Ux2WbJpR5YqO6GbXliXFp8M55HxgC14y0oGjBNQCnUs6nTFm2lwaFiz4kAvvJ9vEIkhn8pD3hzW1dSVeYT86MmkQl3RohmVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707381330; c=relaxed/simple; bh=i+4EJdQagleZnPVT30vGe5GcWcJwF8pGXhFiUpMrbvY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=iy+Zyt+UwUxf+vzgLv026Hi0M967HJDFnXHn9LnWNiWR9DWf4oMVY0GO/kMG3gU7brNp2R0L0cei/W27OtXJG0xOEdU+YRIIqkmVcccMSCwTTZoRGMYfHjiGmB4xUWxSejYrbExha6wDWtPb7pmNmyKoBMAWUn3leKIPgLMVJ6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=3plkq6QD; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707381326; bh=i+4EJdQagleZnPVT30vGe5GcWcJwF8pGXhFiUpMrbvY=; h=From:To:Cc:Subject:Date:From; b=3plkq6QDr0KOy28qxSuhelZKegSfVyetRK0espglhhTPRrjhskVEOF277eHOzNNhc cT9FPWkDWXEMKwTZeW6tdmbDpcYNBcQI4xwZWfALjXBGLakRYhKwPboOJ1R4H6gfqI D2j6rF6/afCXS2ZCg0xF299yv4kU3WCugaK0azfcIF9q+pvDF5W5ygHgH6MBobhh6m fj4MEcfJ6aMiqYEMWdtwZoPQ5vsGpUwdANodbM61JLsgTvqO1APzCdpdWWOFRjd+vp VRwzyvpOTTL8IvTORtJmiWsCAyBz2ssuRdi2JrX1ukKJWEfYgZ3V0hnVWDFUFRw/xb ZXOoZMfrImINQ== Received: from eugen-station.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 764EE3782098; Thu, 8 Feb 2024 08:35:21 +0000 (UTC) From: Eugen Hristev To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@collabora.co, eugen.hristev@collabora.com, Gabriel Krisman Bertazi , Eric Biggers Subject: [RESEND PATCH v9] ext4: Log error when lookup of encoded dentry fails Date: Thu, 8 Feb 2024 10:35:11 +0200 Message-Id: <20240208083511.270636-1-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790319106361287938 X-GMAIL-MSGID: 1790319106361287938 From: Gabriel Krisman Bertazi 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 Signed-off-by: Eugen Hristev Reviewed-by: Gabriel Krisman Bertazi --- Hello, I am trying to respin the series here : https://www.spinics.net/lists/linux-ext4/msg85081.html To make it easier to apply I split it into smaller chunks which address one single thing. This patch simply adds an error message in the UNICODE path. fs/ext4/namei.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 6e7af8dc4dde..7d357c417475 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1477,6 +1477,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;