Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1023477ybi; Fri, 24 May 2019 15:43:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCBRiVxwu9VuBkF+nb8UHiVZnnKRan3csNJgqu4p0rEDDFw3SAv+M6Eg31Kf2hLHi3S8A5 X-Received: by 2002:aa7:9615:: with SMTP id q21mr22626849pfg.253.1558737815863; Fri, 24 May 2019 15:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558737815; cv=none; d=google.com; s=arc-20160816; b=zyZdaWGetJGu9nWdq9GAJ/bIbJbabvwDKAC/knc4ltm6YxTc+G280ofZI9yJUsfR8d fr0qA25eRaW2vZ7u9Hq0+aQ7pwY1XENLFvKkMwCYZOtRzEi2YCuXD46E6srKOIfEpihz rDdn3JKYtJWNz5p2DfmWrj9mmtnvKOVsXziZSgit2WDeQbsfxk0fDXbf9I1mpbQx1/eP LzTxxbzUAUy5xCSEVG6Y//lVQoPcT8ysFkgbSHpcEmvUar8tsnWsiTK3peISZHonXjvT dyMACgNyMqvDaeUE3aShARZ0DlJjG1H0/qNTtrMGsrXHCqZ6G/LF8n1T9hrnYImSoysf UceA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DALUFFrhkT1sE8WT2kZRQuyTGlCwp4p741uNSmu6IwA=; b=IRZeCDXHDhjVQXVjZTxozmhbULJXJcZiJNTjcAA/fWyiou3MYi3+UBRki93fjZqR3C ycVD8gHwu8g1WBwok8y3Gdvff7iuHZwrPxZq/7XkyXd04FPeF9pylSjJVqgyGJuNNFJh bmsfAfsR993bOEzL/lMTITpqTcoxkGi0DoHZH7MrxNTvGe1oKo3kL/WU0GDPOYO94Nqy jPj1LZaMgwWUGyjAoJ5McmNZGO9KlH+LTwYawFYHnRb9weULq7OmxwuaKy7QUaGZRxkT NZjdtu9Ezre1sXc4AHnNFHXmKFYf1Ax2RJG4467BlBeb/IDPgce5fxS77gyOxiMp9YE2 M16A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si6209443pjb.33.2019.05.24.15.43.02; Fri, 24 May 2019 15:43:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbfEXWlg (ORCPT + 99 others); Fri, 24 May 2019 18:41:36 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46960 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbfEXWlf (ORCPT ); Fri, 24 May 2019 18:41:35 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 99374265E40 From: Gabriel Krisman Bertazi To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Subject: [PATCH] ext4: Fix dcache lookup of !casefolded directories Date: Fri, 24 May 2019 18:41:29 -0400 Message-Id: <20190524224129.28525-1-krisman@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Found by visual inspection, this wasn't caught by my xfstest, since it's effect is ignoring positive dentries in the cache the fallback just goes to the disk. it was introduced in the last iteration of the case-insensitive patch. d_compare should return 0 when the entries match, so make sure we are correctly comparing the entire string if the encoding feature is set and we are on a case-INsensitive directory. Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups") Signed-off-by: Gabriel Krisman Bertazi --- fs/ext4/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 884a6e776809..c7843b149a1e 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -671,7 +671,7 @@ static int ext4_d_compare(const struct dentry *dentry, unsigned int len, if (!IS_CASEFOLDED(dentry->d_parent->d_inode)) { if (len != name->len) return -1; - return !memcmp(str, name, len); + return memcmp(str, name->name, len); } return ext4_ci_compare(dentry->d_parent->d_inode, name, &qstr); -- 2.20.1