ANDROID: sync encrypt+casefold support with patches going upstream
The following patches are now queued in f2fs/dev for 5.11, but
android-mainline and android12-5.4 have an old version of them:
libfs: Add generic function for setting dentry_ops
fscrypt: Have filesystems handle their d_ops
f2fs: Handle casefolding with Encryption
Get them up-to-date.
Link: https://lore.kernel.org/linux-f2fs-devel/20201119060904.463807-1-drosen@google.com
Bug: 161184936
Test: kvm-xfstests -c f2fs/default,f2fs/encrypt -g casefold
Change-Id: I359bf4f23631c1b8175de8d5f12d0787fd7f42bd
Signed-off-by: Eric Biggers <ebiggers@google.com>
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 5895f56..63f6ec8 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -774,9 +774,11 @@ static inline int fscrypt_prepare_rename(struct inode *old_dir,
* directory's encryption key is available, then the lookup is assumed to be by
* plaintext name; otherwise, it is assumed to be by no-key name.
*
- * After calling this function, a filesystem should ensure that its dentry
- * operations contain fscrypt_d_revalidate if DCACHE_NOKEY_NAME was set,
- * so that the dentry can be invalidated if the key is later added.
+ * This will set DCACHE_NOKEY_NAME on the dentry if the lookup is by no-key
+ * name. In this case the filesystem must assign the dentry a dentry_operations
+ * which contains fscrypt_d_revalidate (or contains a d_revalidate method that
+ * calls fscrypt_d_revalidate), so that the dentry will be invalidated if the
+ * directory's encryption key is later added.
*
* Return: 0 on success; -ENOENT if the directory's key is unavailable but the
* filename isn't a valid no-key name, so a negative dentry should be created;