Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-27 Thread Eric Biggers
On Sat, Jul 25, 2020 at 07:42:11PM -0700, Eric Biggers wrote: > > Exactly my point. Requiring infrastructure and storage layers to > > obey completely new, undefined, undiscoverable, opaque and variable > > definition of the block devices' "atomic unit of IO", then that's > > simply a non-starter.

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-25 Thread Eric Biggers
On Sun, Jul 26, 2020 at 09:47:51AM +1000, Dave Chinner wrote: > > > > I think you're missing the point here. Currently, the granularity of > > > > encryption > > > > (a.k.a. "data unit size") is always filesystem blocks, so that's the > > > > minimum we > > > > can directly read or write to an e

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-25 Thread Dave Chinner
On Sun, Jul 26, 2020 at 09:47:51AM +1000, Dave Chinner wrote: > On Fri, Jul 24, 2020 at 10:41:32AM -0700, Eric Biggers wrote: > > But again, as far as I can tell, fs/iomap/direct-io.c currently *does* > > guarantee > > that *if* the input is fully filesystem-block-aligned and if blocksize <= > > P

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-25 Thread Dave Chinner
On Fri, Jul 24, 2020 at 10:41:32AM -0700, Eric Biggers wrote: > On Fri, Jul 24, 2020 at 03:31:30PM +1000, Dave Chinner wrote: > > On Thu, Jul 23, 2020 at 08:46:28PM -0700, Eric Biggers wrote: > > > On Fri, Jul 24, 2020 at 11:39:10AM +1000, Dave Chinner wrote: > > > > fscrypt_inode_uses_inline_crypt

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-24 Thread Eric Biggers
On Fri, Jul 24, 2020 at 03:31:30PM +1000, Dave Chinner wrote: > On Thu, Jul 23, 2020 at 08:46:28PM -0700, Eric Biggers wrote: > > On Fri, Jul 24, 2020 at 11:39:10AM +1000, Dave Chinner wrote: > > > fscrypt_inode_uses_inline_crypto() ends up being: > > > > > > if (IS_ENCRYPTED(inode) && S_ISREG(i

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-23 Thread Dave Chinner
On Thu, Jul 23, 2020 at 08:46:28PM -0700, Eric Biggers wrote: > On Fri, Jul 24, 2020 at 11:39:10AM +1000, Dave Chinner wrote: > > fscrypt_inode_uses_inline_crypto() ends up being: > > > > if (IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode) && > > inode->i_crypt_info->ci_inlinecrypt) > >

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-23 Thread Eric Biggers
On Fri, Jul 24, 2020 at 11:39:10AM +1000, Dave Chinner wrote: > > fscrypt_set_bio_crypt_ctx() was introduced by > > "fscrypt: add inline encryption support" on that branch. > > Way too much static inline function abstraction. Well, this is mostly because we're trying to be a good kernel citizen a

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-23 Thread Dave Chinner
On Thu, Jul 23, 2020 at 04:03:45PM -0700, Eric Biggers wrote: > Hi Dave, > > On Fri, Jul 24, 2020 at 08:07:52AM +1000, Dave Chinner wrote: > > > > > @@ -183,11 +184,16 @@ static void > > > > > iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t > > > > > pos, > > > > >

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-23 Thread Eric Biggers
Hi Dave, On Fri, Jul 24, 2020 at 08:07:52AM +1000, Dave Chinner wrote: > > > > @@ -183,11 +184,16 @@ static void > > > > iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, > > > > unsigned len) > > > > { > > > > + struct inode *inode = file_inode(dio->io

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-23 Thread Dave Chinner
On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote: > On Thu, Jul 23, 2020 at 07:16:29AM +1000, Dave Chinner wrote: > > On Mon, Jul 20, 2020 at 11:37:35PM +, Satya Tangirala wrote: > > > From: Eric Biggers > > > > > > Wire up iomap direct I/O with the fscrypt additions for direct I/

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Eric Biggers
On Wed, Jul 22, 2020 at 04:32:47PM -0700, Darrick J. Wong wrote: > On Wed, Jul 22, 2020 at 04:26:25PM -0700, Eric Biggers wrote: > > On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote: > > > So, something like this: > > > > > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > > > index 4

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Darrick J. Wong
On Wed, Jul 22, 2020 at 04:26:25PM -0700, Eric Biggers wrote: > On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote: > > So, something like this: > > > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > > index 44bad4bb8831..2816194db46c 100644 > > --- a/fs/ext4/inode.c > > +++ b/fs/ext4/

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Eric Biggers
On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote: > So, something like this: > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 44bad4bb8831..2816194db46c 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3437,6 +3437,15 @@ static int ext4_iomap_begin(struct inode *i

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Eric Biggers
On Wed, Jul 22, 2020 at 11:44:07PM +0100, Matthew Wilcox wrote: > On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote: > > > Which means you are now placing a new constraint on this code in > > > that we cannot ever, in future, zero entire blocks here. > > > > > > This code can issue arbi

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Matthew Wilcox
On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote: > > Which means you are now placing a new constraint on this code in > > that we cannot ever, in future, zero entire blocks here. > > > > This code can issue arbitrary sized zeroing bios - multiple entire fs blocks > > blocks if necessa

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Eric Biggers
On Thu, Jul 23, 2020 at 07:16:29AM +1000, Dave Chinner wrote: > On Mon, Jul 20, 2020 at 11:37:35PM +, Satya Tangirala wrote: > > From: Eric Biggers > > > > Wire up iomap direct I/O with the fscrypt additions for direct I/O. > > This allows ext4 to support direct I/O on encrypted files when in

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Dave Chinner
On Mon, Jul 20, 2020 at 11:37:35PM +, Satya Tangirala wrote: > From: Eric Biggers > > Wire up iomap direct I/O with the fscrypt additions for direct I/O. > This allows ext4 to support direct I/O on encrypted files when inline > encryption is enabled. > > This change consists of two parts: >

Re: [f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-22 Thread Jaegeuk Kim
On 07/20, Satya Tangirala wrote: > From: Eric Biggers > > Wire up iomap direct I/O with the fscrypt additions for direct I/O. > This allows ext4 to support direct I/O on encrypted files when inline > encryption is enabled. > > This change consists of two parts: > > - Set a bio_crypt_ctx on bios

[f2fs-dev] [PATCH v4 3/7] iomap: support direct I/O with fscrypt using blk-crypto

2020-07-20 Thread Satya Tangirala via Linux-f2fs-devel
From: Eric Biggers Wire up iomap direct I/O with the fscrypt additions for direct I/O. This allows ext4 to support direct I/O on encrypted files when inline encryption is enabled. This change consists of two parts: - Set a bio_crypt_ctx on bios for encrypted files, so that the file contents g