Linux FSCRYPT development
 help / color / mirror / Atom feed
* Re: [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption
       [not found] <20201113034348.12131-1-koulihong@huawei.com>
@ 2020-11-13  2:57 ` Eric Biggers
  0 siblings, 0 replies; only message in thread
From: Eric Biggers @ 2020-11-13  2:57 UTC (permalink / raw)
  To: Lihong Kou
  Cc: yuchao0, jaegeuk, linux-f2fs-devel, Satya Tangirala,
	linux-fscrypt

On Fri, Nov 13, 2020 at 11:43:48AM +0800, Lihong Kou wrote:
> Now we have inline encrytion and fs layer encrption in the kernel, when we
> choose inline encryption, we should not use bufferd IO instead of direct IO.
> 
> Signed-off-by: Lihong Kou <koulihong@huawei.com>
> ---
>  fs/f2fs/f2fs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index cb700d797296..ccc5c9734f55 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -3889,8 +3889,8 @@ static inline void f2fs_set_encrypted_inode(struct inode *inode)
>   */
>  static inline bool f2fs_post_read_required(struct inode *inode)
>  {
> -	return f2fs_encrypted_file(inode) || fsverity_active(inode) ||
> -		f2fs_compressed_file(inode);
> +	return (f2fs_encrypted_file(inode) && fscrypt_inode_uses_fs_layer_crypto(inode))
> +		|| fsverity_active(inode) || f2fs_compressed_file(inode);
>  }

This isn't correct for upstream because upstream doesn't support direct I/O with
fscrypt inline encryption yet.  The patchset to support direct I/O with fscrypt
inline encryption was last sent out at
https://lkml.kernel.org/linux-fscrypt/20200720233739.824943-1-satyat@google.com.
I believe that Satya is planning to send it again soon.

On the other hand, downstream, the Android common kernels have the fscrypt
direct I/O support already, and f2fs_force_buffered_io() has been updated
accordingly.  If you're using one of the Android common kernels, can you make
sure it's up-to-date?

- Eric

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-13  2:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20201113034348.12131-1-koulihong@huawei.com>
2020-11-13  2:57 ` [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox