Linux FSCRYPT development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Lihong Kou <koulihong@huawei.com>
Cc: yuchao0@huawei.com, jaegeuk@kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	Satya Tangirala <satyat@google.com>,
	linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption
Date: Thu, 12 Nov 2020 18:57:38 -0800	[thread overview]
Message-ID: <X632Ivd2KfuUrGzx@sol.localdomain> (raw)
In-Reply-To: <20201113034348.12131-1-koulihong@huawei.com>

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

           reply	other threads:[~2020-11-13  2:57 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20201113034348.12131-1-koulihong@huawei.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X632Ivd2KfuUrGzx@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=koulihong@huawei.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=satyat@google.com \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox