linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org
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 <krisman@collabora.com>
Subject: [f2fs-dev] [PATCH 6/7] ext4: Enable negative dentries on case-insensitive lookup
Date: Wed, 22 Jun 2022 15:46:02 -0400	[thread overview]
Message-ID: <20220622194603.102655-7-krisman@collabora.com> (raw)
In-Reply-To: <20220622194603.102655-1-krisman@collabora.com>

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 <krisman@collabora.com>
---
 fs/ext4/namei.c | 35 ++++-------------------------------
 1 file changed, 4 insertions(+), 31 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index db4ba99d1ceb..9908ad6cb071 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1823,16 +1823,9 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
 		}
 	}
 
-#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.
-		 */
-		return NULL;
-	}
-#endif
+	if (IS_ENABLED(CONFIG_UNICODE) && IS_CASEFOLDED(dir))
+		d_set_casefold_lookup(dentry);
+
 	return d_splice_alias(inode, dentry);
 }
 
@@ -3153,17 +3146,6 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
 	ext4_fc_track_unlink(handle, dentry);
 	retval = ext4_mark_inode_dirty(handle, dir);
 
-#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 ext4_lookup(), when it is better
-	 * supported by the VFS for the CI case.
-	 */
-	if (IS_CASEFOLDED(dir))
-		d_invalidate(dentry);
-#endif
-
 end_rmdir:
 	brelse(bh);
 	if (handle)
@@ -3258,16 +3240,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
 	retval = __ext4_unlink(handle, dir, &dentry->d_name, d_inode(dentry));
 	if (!retval)
 		ext4_fc_track_unlink(handle, dentry);
-#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 ext4_lookup(), when it is  better
-	 * supported by the VFS for the CI case.
-	 */
-	if (IS_CASEFOLDED(dir))
-		d_invalidate(dentry);
-#endif
+
 	if (handle)
 		ext4_journal_stop(handle);
 
-- 
2.36.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  parent reply	other threads:[~2022-06-22 19:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 19:45 [f2fs-dev] [PATCH 0/7] Support negative dentries on case-insensitive directories Gabriel Krisman Bertazi
2022-06-22 19:45 ` [f2fs-dev] [PATCH 1/7] fs: Expose name under lookup to d_revalidate hook Gabriel Krisman Bertazi
2023-03-23 14:33   ` Theodore Ts'o
2023-03-25 13:33     ` Theodore Ts'o
2023-03-26  5:03       ` Al Viro
2022-06-22 19:45 ` [f2fs-dev] [PATCH 2/7] fs: Add DCACHE_CASEFOLD_LOOKUP flag Gabriel Krisman Bertazi
2023-03-23 14:33   ` Theodore Ts'o
2022-06-22 19:45 ` [f2fs-dev] [PATCH 3/7] libfs: Validate negative dentries in case-insensitive directories Gabriel Krisman Bertazi
2023-03-23 14:36   ` Theodore Ts'o
2023-03-26  4:46   ` Al Viro
2023-03-31 15:31     ` Gabriel Krisman Bertazi
2022-06-22 19:46 ` [f2fs-dev] [PATCH 4/7] libfs: Support revalidation of encrypted case-insensitive dentries Gabriel Krisman Bertazi
2023-03-23 14:37   ` Theodore Ts'o
2022-06-22 19:46 ` [f2fs-dev] [PATCH 5/7] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops Gabriel Krisman Bertazi
2023-03-23 14:39   ` Theodore Ts'o
2022-06-22 19:46 ` Gabriel Krisman Bertazi [this message]
2022-06-23  7:29   ` [f2fs-dev] [PATCH 6/7] ext4: Enable negative dentries on case-insensitive lookup kernel test robot
2022-06-23 16:36     ` Gabriel Krisman Bertazi
2023-03-23 14:39   ` Theodore Ts'o
2022-06-22 19:46 ` [f2fs-dev] [PATCH 7/7] f2fs: " Gabriel Krisman Bertazi
2022-06-23 12:44   ` kernel test robot
2023-02-24 22:36 ` [f2fs-dev] [PATCH 0/7] Support negative dentries on case-insensitive directories Daniel Rosenberg via Linux-f2fs-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220622194603.102655-7-krisman@collabora.com \
    --to=krisman@collabora.com \
    --cc=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=kernel@collabora.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).