From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F033AC433EF for ; Wed, 1 Jun 2022 20:45:14 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nwVDN-0008SY-EB; Wed, 01 Jun 2022 20:45:14 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nwVDM-0008SK-MT for linux-f2fs-devel@lists.sourceforge.net; Wed, 01 Jun 2022 20:45:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gWRWNWye4PcdF7lI0M0U4gfLeESrCH0Yj+w5wmwtsiI=; b=lwE+8OpGZYcbIcsNo6omcKFpV0 SIsRJ+vo3fzuA9kKBMaQuTyV1m8n4wu8Db59g0VnIpYdJZCq3RZw7ANnNNxvqgXxRlAnqTGqYL65D Cxziudf3Kz9awgackyl3fzZH16RudD4x9TZRMNpJE/0jHa/a2nfts3VR4f4qSBEm9I48=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gWRWNWye4PcdF7lI0M0U4gfLeESrCH0Yj+w5wmwtsiI=; b=KMI7bkfLqPqZfKf0MAJd9IJtRz MIJ8U7wUD60kjxDQvKXey49hiqCqgZbckOk5eWMzJOVCDPOMDFPNhGU8MkQT/PzeGiax8ib/TXU8h yQiQLQcI+49DK/ywxc6cOsY4yXLwPY9bAviXlTx9Vp/d4hlzwCe7OWr3OVgwN9uIh6Hc=; Received: from bhuna.collabora.co.uk ([46.235.227.227]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1nwVDL-0002AO-Bt for linux-f2fs-devel@lists.sourceforge.net; Wed, 01 Jun 2022 20:45:13 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 5801E1F439CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1654116306; bh=zjpVlfAXrXnU0rpRBkZ+HN/BTZ7hL7eHUnAgHGTfavg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZZGw7BwF4X0XYqwVzi375rxpQiLfsc8cdhxMWbsAwinPEp5HxvjrNxuxHCIecSbne CetTasRpb0JKPWKbZZ/j6R5T3Hyjeg3EfWqY3O+/MV3vfmf/jqsgPspKDCubfUX339 TxVa5Htk5No9SiHm1hSALFw/MARMYcvE11+yI27MCxlS4ovgcZecK7APviG5EZA4T5 q6gIB+w1hOKzeXFgD/VzWgG8zESBzDsm/JAYeSD/BNnx3zbcF8xw+zl4gQdHYKtjy8 85qBSaYBdgtLOMO5ADyg3SI5mXXT2a/15dlgD5sZtGD9mbLkMYT/w6WL6WtN069qHV H6VKY7/egyQWQ== From: Gabriel Krisman Bertazi To: viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org Date: Wed, 1 Jun 2022 16:44:37 -0400 Message-Id: <20220601204437.676872-8-krisman@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220601204437.676872-1-krisman@collabora.com> References: <20220601204437.676872-1-krisman@collabora.com> MIME-Version: 1.0 X-Headers-End: 1nwVDL-0002AO-Bt Subject: [f2fs-dev] [PATCH RFC 7/7] f2fs: Enable negative dentries on case-insensitive lookup X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@collabora.com, linux-f2fs-devel@lists.sourceforge.net, ebiggers@kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Instead of invalidating negative dentries during case-insensitive lookups, mark them as such and let them be added to the dcache. d_ci_revalidate is able to properly filter them out if necessary based on the dentry casefold flag. Signed-off-by: Gabriel Krisman Bertazi --- fs/f2fs/namei.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 5ed79b29999f..6e970a6c3623 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -562,17 +562,8 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, goto out_iput; } out_splice: -#if IS_ENABLED(CONFIG_UNICODE) - if (!inode && IS_CASEFOLDED(dir)) { - /* Eventually we want to call d_add_ci(dentry, NULL) - * for negative dentries in the encoding case as - * well. For now, prevent the negative dentry - * from being cached. - */ - trace_f2fs_lookup_end(dir, dentry, ino, err); - return NULL; - } -#endif + if (IS_ENABLED(CONFIG_UNICODE) && IS_CASEFOLDED(dir)) + d_set_casefold_lookup(dentry); new = d_splice_alias(inode, dentry); err = PTR_ERR_OR_ZERO(new); trace_f2fs_lookup_end(dir, dentry, ino, !new ? -ENOENT : err); @@ -623,16 +614,6 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) goto fail; } f2fs_delete_entry(de, page, dir, inode); -#if IS_ENABLED(CONFIG_UNICODE) - /* VFS negative dentries are incompatible with Encoding and - * Case-insensitiveness. Eventually we'll want avoid - * invalidating the dentries here, alongside with returning the - * negative dentries at f2fs_lookup(), when it is better - * supported by the VFS for the CI case. - */ - if (IS_CASEFOLDED(dir)) - d_invalidate(dentry); -#endif f2fs_unlock_op(sbi); if (IS_DIRSYNC(dir)) -- 2.36.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel