Thread (14 messages) 14 messages, 4 authors, 2021-07-24
STALE1784d REVIEWED: 2 (2M)
Revisions (3)
  1. v7 [diff vs current]
  2. v8 [diff vs current]
  3. v9 current

[PATCH v9 8/9] f2fs: support direct I/O with fscrypt using blk-crypto

From: Satya Tangirala <hidden>
Date: 2021-06-04 21:09:30
Also in: linux-block, linux-f2fs-devel, linux-fscrypt, linux-xfs, lkml
Subsystem: f2fs file system, filesystems (vfs and infrastructure), the rest · Maintainers: Jaegeuk Kim, Chao Yu, Alexander Viro, Christian Brauner, Linus Torvalds

From: Eric Biggers <redacted>

Wire up f2fs with fscrypt direct I/O support. direct I/O with fscrypt is
only supported through blk-crypto (i.e. CONFIG_BLK_INLINE_ENCRYPTION must
have been enabled, the 'inlinecrypt' mount option must have been specified,
and either hardware inline encryption support must be present or
CONFIG_BLK_INLINE_ENCYRPTION_FALLBACK must have been enabled). Further,
direct I/O on encrypted files is only supported when the *length* of the
I/O is aligned to the filesystem block size (which is *not* necessarily the
same as the block device's block size).

Signed-off-by: Eric Biggers <redacted>
Co-developed-by: Satya Tangirala <redacted>
Signed-off-by: Satya Tangirala <redacted>
Acked-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/f2fs.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c83d90125ebd..a416ea3a1a04 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -4181,7 +4181,11 @@ static inline bool f2fs_force_buffered_io(struct inode *inode,
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	int rw = iov_iter_rw(iter);
 
-	if (f2fs_post_read_required(inode))
+	if (!fscrypt_dio_supported(iocb, iter))
+		return true;
+	if (fsverity_active(inode))
+		return true;
+	if (f2fs_compressed_file(inode))
 		return true;
 	if (f2fs_is_multi_device(sbi))
 		return true;
-- 
2.32.0.rc1.229.g3e70b5a671-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help