mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 05:34:13 +08:00
d19d8d345e
The new helper function fscrypt_prepare_new_inode() runs before
S_ENCRYPTED has been set on the new inode. This accidentally made
fscrypt_select_encryption_impl() never enable inline encryption on newly
created files, due to its use of fscrypt_needs_contents_encryption()
which only returns true when S_ENCRYPTED is set.
Fix this by using S_ISREG() directly instead of
fscrypt_needs_contents_encryption(), analogous to what
select_encryption_mode() does.
I didn't notice this earlier because by design, the user-visible
behavior is the same (other than performance, potentially) regardless of
whether inline encryption is used or not.
Fixes:
|
||
---|---|---|
.. | ||
bio.c | ||
crypto.c | ||
fname.c | ||
fscrypt_private.h | ||
hkdf.c | ||
hooks.c | ||
inline_crypt.c | ||
Kconfig | ||
keyring.c | ||
keysetup_v1.c | ||
keysetup.c | ||
Makefile | ||
policy.c |