Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2160076lqz; Tue, 2 Apr 2024 08:51:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7d+fhbDUIEyrrRSLwA6ShkPumD9ZE1VUqViHhZWlJMJ4OA2s8Kb10CSc3SRvj+xS6pOMw7AhC84t5TRdO8XgPDA/XXaY6kz87gQEtfA== X-Google-Smtp-Source: AGHT+IFiEdIhPwe7eIWFuR5IDD00hrmCisCtcs5QiV29PTt1zVPA1g4LMWllDkTE0JZdL8VqVKNE X-Received: by 2002:a05:6402:27ce:b0:56d:b687:5a57 with SMTP id c14-20020a05640227ce00b0056db6875a57mr9312244ede.20.1712073078473; Tue, 02 Apr 2024 08:51:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712073078; cv=pass; d=google.com; s=arc-20160816; b=D5BNNHAN2fyPcvMt8TWl9h8RA7VXLa3XxBD5oNwp9Tt0ndNqMnwa+7czNuRhfIJPyR jMyI4R1yHVzeh7d4SDMkD2282EzQZ07IvPV1DEQMa/Cic+FYm7BAgyNGRhAn6D/WIW9K 4tJzDWPWxfS3HV8m2rPfljkGGH5rcumAF4H38onyF1YtNIe0yhxxH+6KhnHBAJp5cusx ryrQnq4K0uzMKn0OCP1fjuJykrT0PW1cRX4HD9PKzI/Amkuqu+LX+5TAMNmAK1jIXuhm liFpO8CjB/gk7Sngu3U1FJkTwK3FkBooT+KYEufjNYdCoT1Mkcys11/JQB91J0moKoiz xLGg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CHRzt4jsIq4Oa125HeJ+JV37wGYiasMe0OFhsxhy3w8=; fh=leNjPu/3B1/amj8pWgnZPg+v2NORBP0eXUn2DeKKAIs=; b=Zt75krH/se9IM6VO+oFLu4mvqhsgy6r0YtHJwyW6icw7WDH8yMJAn297QDDQtVVKQm 3ZPeCk5FVuCCGIbzdJRKoKdawrFiAEt/t4CnKLWoKHmGe84YZlQicWitTKx0wWyTgPsA cbIG3OMBmScC0D/bYUofMViE0YNa4BH1mVQT6NK9NVXrl7jPy7noLOK2DCL+1L+2LLaC /8E8V5vJnYNnHF5DHPQwMLxteHHccQtmJJ3cK8pO1NDVvlsc3QL3BsOKHD47qWL2BuHG 6sa5ZRoyQqrCPD09ctBTwtiYwEcpD89k3nxiVKb4keJ3LYEe50fgQUV/21RL6KuLfCi8 drUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="DOrp/SL4"; 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-ext4+bounces-1832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m27-20020a50999b000000b0056dfba5f10dsi71441edb.669.2024.04.02.08.51.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 08:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="DOrp/SL4"; 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-ext4+bounces-1832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1832-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 38AEB1F22659 for ; Tue, 2 Apr 2024 15:51:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D59011386B7; Tue, 2 Apr 2024 15:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="DOrp/SL4" X-Original-To: linux-ext4@vger.kernel.org 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 85E12136675; Tue, 2 Apr 2024 15:48:58 +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=1712072940; cv=none; b=H+s/9lvsubO19p1lstBOEasFw6o6vdw3EKLzEU290C+VxkyhOIuFCz1fXXsoIaCQVgCDES8nRLpl0ZtGDnY+yBNLsJWOrWpG+hkEqs5czxGQ94KLIeAcMz9yKGu6/mjs6OsfPNcmCUz9Vh2kXZrK2FL98jXfbuoU0XXRoeUJZ0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712072940; c=relaxed/simple; bh=IfRmBs/VQkfKjJFkvo6pie00L4VVXFYihT/akWQE4ic=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jZQ1jApTcetv2IBGHdDs2LwIuB2SgWw2JsbNz3br1D6Xu/68wiMI5nRzUmzNETx64Ws3y6VtBsPkb/iRmrFLIcEix3hD6JvlI+QkX7j9kmK7FfaTS+aJ0omK3vW9lpAe3+fTkg4PI+E5yf+UnGXGoeraTO2fIHF4a0NTh7zNODA= 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=DOrp/SL4; 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=1712072936; bh=IfRmBs/VQkfKjJFkvo6pie00L4VVXFYihT/akWQE4ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOrp/SL4kYewXK66WVjQc1/mDm1Tmp7wW7CniDjHoGxjckveBZJKXBF9PkUkRw0dt /8Gg8nKilcx92NCErLQF4hTJ4XO+qzFjh8nAz4ZgNOJduwAlISMXqHwAsJp4yXesCR F9RXo5Lhhj1Bn3DsE/ZELAptMvrhcYnSANtSj9Eq6rR51dUIBKiU7NZBHxQWdDgI2L qlGy5py7/8LavzFbWm8PDVEhOzU8owFrpXtKV7dF3oAqWmx4d8Q8RiTeYdx7GK8pme ulyb8ATrbw+S3jrqBCwTbcxMQN4OI+ybvlQ9vy5fDK4oZSfvPhVg3PHn5/MKM+EoX9 KXXd9Hw+88QtA== 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 E417337820F9; Tue, 2 Apr 2024 15:48:55 +0000 (UTC) From: Eugen Hristev To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, jaegeuk@kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@collabora.com, eugen.hristev@collabora.com, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, krisman@suse.de Subject: [PATCH v15 7/9] f2fs: Log error when lookup of encoded dentry fails Date: Tue, 2 Apr 2024 18:48:40 +0300 Message-Id: <20240402154842.508032-8-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240402154842.508032-1-eugen.hristev@collabora.com> References: <20240402154842.508032-1-eugen.hristev@collabora.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If the volume is in strict mode, generi c_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. Suggested-by: Gabriel Krisman Bertazi Signed-off-by: Eugen Hristev --- fs/f2fs/dir.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 88b0045d0c4f..64286d80dd30 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -192,11 +192,16 @@ static inline int f2fs_match_name(const struct inode *dir, struct fscrypt_name f; #if IS_ENABLED(CONFIG_UNICODE) - if (fname->cf_name.name) - return generic_ci_match(dir, fname->usr_fname, - &fname->cf_name, - de_name, de_name_len); - + if (fname->cf_name.name) { + int ret = generic_ci_match(dir, fname->usr_fname, + &fname->cf_name, + de_name, de_name_len); + if (ret == -EINVAL) + f2fs_warn(F2FS_SB(dir->i_sb), + "Directory contains filename that is invalid UTF-8"); + + return ret; + } #endif f.usr_fname = fname->usr_fname; f.disk_name = fname->disk_name; -- 2.34.1