* Re: [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption
2020-11-13 3:43 [f2fs-dev] [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption Lihong Kou
@ 2020-11-13 2:57 ` Eric Biggers
0 siblings, 0 replies; 3+ messages 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] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption
@ 2020-11-13 2:57 ` Eric Biggers
0 siblings, 0 replies; 3+ messages in thread
From: Eric Biggers @ 2020-11-13 2:57 UTC (permalink / raw)
To: Lihong Kou; +Cc: jaegeuk, Satya Tangirala, linux-fscrypt, linux-f2fs-devel
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
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [f2fs-dev] [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption
@ 2020-11-13 3:43 Lihong Kou
2020-11-13 2:57 ` [f2fs-dev] " Eric Biggers
0 siblings, 1 reply; 3+ messages in thread
From: Lihong Kou @ 2020-11-13 3:43 UTC (permalink / raw)
To: yuchao0, jaegeuk; +Cc: linux-f2fs-devel
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);
}
/*
--
2.17.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-13 2:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 3:43 [f2fs-dev] [PATCH] f2fs: fix the bug in f2fs_direct_IO with inline encryption Lihong Kou
2020-11-13 2:57 ` Eric Biggers
2020-11-13 2:57 ` [f2fs-dev] " Eric Biggers
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.