Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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().

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
d76af0d6 7bcd0cfa

-6
-6
fs/f2fs/namei.c
··· 874 874 if (!f2fs_is_checkpoint_ready(sbi)) 875 875 return -ENOSPC; 876 876 877 - if (IS_ENCRYPTED(dir) || DUMMY_ENCRYPTION_ENABLED(sbi)) { 878 - int err = fscrypt_get_encryption_info(dir); 879 - if (err) 880 - return err; 881 - } 882 - 883 877 return __f2fs_tmpfile(dir, dentry, mode, NULL); 884 878 } 885 879