Skip to contentSkip to conversation

f2fs: don't call fscrypt_get_encryption_info() explicitly in f2fs_tmpfile()

PATCH New Chao Yu 1 participant 1 message Mar 21, 2020 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH 1/1 f2fs: don't call fscrypt_get_encryption_info() explicitly in f2fs_tmpfile()

From: Chao Yu <[email protected]>

In f2fs_tmpfile(), parent inode's encryption info is only used when inheriting encryption context to its child inode, however, we have already called fscrypt_get_encryption_info() in fscrypt_inherit_context() to get the encryption info, so just removing unneeded one in f2fs_tmpfile().

---
 fs/f2fs/namei.c | 6 ------
 1 file changed, 6 deletions(-)
fs/f2fs/namei.c +0 -6
index 95cfbce062e8..f54119da2217 100644
@@ -874,12 +874,6 @@ static int f2fs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
 	if (!f2fs_is_checkpoint_ready(sbi))
 		return -ENOSPC;
 
-	if (IS_ENCRYPTED(dir) || DUMMY_ENCRYPTION_ENABLED(sbi)) {
-		int err = fscrypt_get_encryption_info(dir);
-		if (err)
-			return err;
-	}
-
 	return __f2fs_tmpfile(dir, dentry, mode, NULL);
 }
 
Signature · 1 line
2.22.0