Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-11-04 Thread Eric Biggers
On Thu, Oct 31, 2019 at 02:21:03PM -0700, Christoph Hellwig wrote: > > > > > > Btw, I'm not happy about the 8-byte IV assumptions everywhere here. > > > That really should be a parameter, not hardcoded. > > > > To be clear, the 8-byte IV assumption doesn't really come from fs/crypto/, > > but >

Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-11-04 Thread Eric Biggers
On Mon, Nov 04, 2019 at 04:15:54PM -0800, Christoph Hellwig wrote: > > I don't think combining these things is a good idea because it would > > restrict > > the use of inline encryption to filesystems that allow IV_INO_LBLK_64 > > encryption > > policies, i.e. filesystems that have stable inode n

Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-11-04 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 03:25:03PM -0700, Eric Biggers wrote: > It's more important to clean up the IS_ENCRYPTED(inode) && > S_ISREG(inode->i_mode) checks that are duplicated in fs/{ext4,f2fs}/, so I've > been thinking of adding a helper: > > static inline bool fscrypt_needs_contents_encryption(co

Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-10-31 Thread Eric Biggers
On Thu, Oct 31, 2019 at 02:21:03PM -0700, Christoph Hellwig wrote: > On Thu, Oct 31, 2019 at 01:21:26PM -0700, Eric Biggers wrote: > > > > + /* The file must need contents encryption, not filenames > > > > encryption */ > > > > + if (!S_ISREG(inode->i_mode)) > > > > + ret

Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-10-31 Thread Christoph Hellwig
On Thu, Oct 31, 2019 at 01:21:26PM -0700, Eric Biggers wrote: > > > + /* The file must need contents encryption, not filenames encryption */ > > > + if (!S_ISREG(inode->i_mode)) > > > + return false; > > > > But that isn't really what the check checks for.. > > This is how fscrypt has alw

Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-10-31 Thread Eric Biggers
Hi Christoph, thanks for reviewing this. On Thu, Oct 31, 2019 at 11:32:17AM -0700, Christoph Hellwig wrote: > > diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c > > index 1f4b8a277060..956798debf71 100644 > > --- a/fs/crypto/bio.c > > +++ b/fs/crypto/bio.c > > @@ -46,26 +46,38 @@ int fscrypt_zeroout

Re: [f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-10-31 Thread Christoph Hellwig
> diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c > index 1f4b8a277060..956798debf71 100644 > --- a/fs/crypto/bio.c > +++ b/fs/crypto/bio.c > @@ -46,26 +46,38 @@ int fscrypt_zeroout_range(const struct inode *inode, > pgoff_t lblk, > { > const unsigned int blockbits = inode->i_blkbits; >

[f2fs-dev] [PATCH v5 7/9] fscrypt: add inline encryption support

2019-10-28 Thread Satya Tangirala via Linux-f2fs-devel
Add support for inline encryption to fs/crypto/. With "inline encryption", the block layer handles the decryption/encryption as part of the bio, instead of the filesystem doing the crypto itself via Linux's crypto API. This model is needed in order to take advantage of the inline encryption hardw