[f2fs-dev] [RFC PATCH V2 10/14] ext4: Decrypt the block that needs to be partially zeroed

2019-04-14 Thread Chandan Rajendra
__ext4_block_zero_page_range decrypts the entire page. This commit decrypts the block to be partially zeroed instead of the whole page. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c

[f2fs-dev] [RFC PATCH V2 12/14] ext4: Compute logical block and the page range to be encrypted

2019-04-14 Thread Chandan Rajendra
For subpage-sized blocks, the initial logical block number mapped by a page can be different from page->index. Hence this commit adds code to compute the first logical block mapped by the page and also the page range to be encrypted. Signed-off-by: Chandan Rajendra --- fs/ext4/page-io.c

[f2fs-dev] [RFC PATCH V2 09/14] ext4: Decrypt all boundary blocks when doing buffered write

2019-04-14 Thread Chandan Rajendra
With subpage sized blocks, ext4_block_write_begin() can have up to two blocks to decrypt. Hence this commit invokes fscrypt_decrypt_page() for each of those blocks. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 33 +++-- 1 file changed, 23 insertions(+), 10

[f2fs-dev] [PATCH V3 5/7] ext4: Wire up ext4_readpage[s] to use mpage_readpage[s]

2019-06-16 Thread Chandan Rajendra
Now that do_mpage_readpage() is "post read process" aware, this commit gets ext4_readpage[s] to use mpage_readpage[s] and deletes ext4's readpage.c since the associated functionality is not required anymore. Signed-off-by: Chandan Rajendra --- fs/ext4/Makefile | 2 +- fs/ex

[f2fs-dev] [PATCH V3 6/7] Add decryption support for sub-pagesized blocks

2019-06-16 Thread Chandan Rajendra
To support decryption of sub-pagesized blocks this commit adds code to, 1. Track buffer head in "struct read_callbacks_ctx". 2. Pass buffer head argument to all read callbacks. 3. Add new fscrypt helper to decrypt the file data referred to by a buffer head. Signed-off-by: Chanda

[f2fs-dev] [PATCH V3 2/7] Integrate read callbacks into Ext4 and F2FS

2019-06-16 Thread Chandan Rajendra
This commit gets Ext4 and F2FS to make use of read callbacks API to perform decryption of file data read from the disk. --- fs/crypto/bio.c | 30 + fs/crypto/crypto.c | 1 + fs/crypto/fscrypt_private.h | 3 + fs/ext4/readpage.c | 29 +++--

[f2fs-dev] [PATCH V3 1/7] FS: Introduce read callbacks

2019-06-16 Thread Chandan Rajendra
by the endio function associated with the read operation. Signed-off-by: Chandan Rajendra --- fs/Kconfig | 3 + fs/Makefile| 2 + fs/crypto/Kconfig | 1 + fs/crypto/bio.c| 11 +++ fs/read_callbacks.c| 174

[f2fs-dev] [PATCH V3 4/7] fs/mpage.c: Integrate read callbacks

2019-06-16 Thread Chandan Rajendra
underlying disk. Signed-off-by: Chandan Rajendra --- fs/mpage.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/mpage.c b/fs/mpage.c index 436a85260394..611ad122fc92 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -30,6 +30,7 @@ #include #include #include

[f2fs-dev] [PATCH V3 0/7] Consolidate FS read I/O callbacks code

2019-06-16 Thread Chandan Rajendra
t_page() code by executing fstests on UBIFS. 2. Implement F2fs function call back to check if the contents of a page holding a verity file's data needs to be verified. RFC V1 -> RFC V2: 1. Describe the purpose of "Post processing code" in the cover letter. 2. Fix build errors when CON

[f2fs-dev] [PATCH V3 3/7] fscrypt: remove struct fscrypt_ctx

2019-06-16 Thread Chandan Rajendra
es the structure and the associated code. Signed-off-by: Chandan Rajendra --- fs/crypto/crypto.c | 89 + include/linux/fscrypt.h | 25 2 files changed, 2 insertions(+), 112 deletions(-) diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c

Re: [f2fs-dev] [PATCH V3 0/7] Consolidate FS read I/O callbacks code

2019-06-25 Thread Chandan Rajendra
On Saturday, June 22, 2019 3:45:51 AM IST Eric Biggers wrote: > On Sun, Jun 16, 2019 at 09:38:06PM +0530, Chandan Rajendra wrote: > > This patchset moves the "FS read I/O callbacks" code into a file of its > > own (i.e. fs/read_callbacks.c) and modifies the generic >

Re: [f2fs-dev] [PATCH V3 2/7] Integrate read callbacks into Ext4 and F2FS

2019-06-25 Thread Chandan Rajendra
On Saturday, June 22, 2019 2:38:01 AM IST Eric Biggers wrote: > Hi Chandan, > > On Sun, Jun 16, 2019 at 09:38:08PM +0530, Chandan Rajendra wrote: > > This commit gets Ext4 and F2FS to make use of read callbacks API to > > perform decryption of file data read from the disk. &

Re: [f2fs-dev] [PATCH V3 4/7] fs/mpage.c: Integrate read callbacks

2019-06-25 Thread Chandan Rajendra
On Saturday, June 22, 2019 2:44:55 AM IST Eric Biggers wrote: > On Sun, Jun 16, 2019 at 09:38:10PM +0530, Chandan Rajendra wrote: > > This commit adds code to make do_mpage_readpage() to be "read callbacks" > > aware i.e. for files requiring decryption, do_mpage_readpage()

Re: [f2fs-dev] [PATCH V3 6/7] Add decryption support for sub-pagesized blocks

2019-06-25 Thread Chandan Rajendra
On Saturday, June 22, 2019 2:59:17 AM IST Eric Biggers wrote: > On Sun, Jun 16, 2019 at 09:38:12PM +0530, Chandan Rajendra wrote: > > To support decryption of sub-pagesized blocks this commit adds code to, > > 1. Track buffer head in "struct read_callbacks_ctx". > &g

Re: [f2fs-dev] [PATCH V3 1/7] FS: Introduce read callbacks

2019-06-25 Thread Chandan Rajendra
On Saturday, June 22, 2019 1:33:57 AM IST Eric Biggers wrote: > Hi Chandan, > > On Sun, Jun 16, 2019 at 09:38:07PM +0530, Chandan Rajendra wrote: > > Read callbacks implements a state machine to be executed after a > > buffered read I/O is completed. They help in furthe

Re: [f2fs-dev] [PATCH V2 12/13] fscrypt_zeroout_range: Encrypt all zeroed out blocks of a page

2019-05-01 Thread Chandan Rajendra
On Tuesday, April 30, 2019 10:21:15 PM IST Eric Biggers wrote: > On Sun, Apr 28, 2019 at 10:01:20AM +0530, Chandan Rajendra wrote: > > For subpage-sized blocks, this commit adds code to encrypt all zeroed > > out blocks mapped by a page. > > > > Signed-off-by: Chanda

Re: [f2fs-dev] [PATCH V2 02/13] Consolidate "read callbacks" into a new file

2019-05-01 Thread Chandan Rajendra
On Tuesday, April 30, 2019 7:07:28 AM IST Chao Yu wrote: > On 2019/4/28 12:31, Chandan Rajendra wrote: > > The "read callbacks" code is used by both Ext4 and F2FS. Hence to > > remove duplicity, this commit moves the code into > > include/linux/read_call

Re: [f2fs-dev] [PATCH V2 02/13] Consolidate "read callbacks" into a new file

2019-05-01 Thread Chandan Rajendra
On Tuesday, April 30, 2019 5:30:28 AM IST Eric Biggers wrote: > Hi Chandan, > > On Sun, Apr 28, 2019 at 10:01:10AM +0530, Chandan Rajendra wrote: > > The "read callbacks" code is used by both Ext4 and F2FS. Hence to > > remove duplicity, this commit moves

Re: [f2fs-dev] [PATCH V2 07/13] Add decryption support for sub-pagesized blocks

2019-05-01 Thread Chandan Rajendra
Hi Eric, On Tuesday, April 30, 2019 6:08:18 AM IST Eric Biggers wrote: > On Sun, Apr 28, 2019 at 10:01:15AM +0530, Chandan Rajendra wrote: > > To support decryption of sub-pagesized blocks this commit adds code to, > > 1. Track buffer head in "struct read_callbacks_ctx"

Re: [f2fs-dev] [PATCH V2 02/13] Consolidate "read callbacks" into a new file

2019-05-01 Thread Chandan Rajendra
On Tuesday, April 30, 2019 11:35:08 PM IST Eric Biggers wrote: > On Sun, Apr 28, 2019 at 10:01:10AM +0530, Chandan Rajendra wrote: > > The "read callbacks" code is used by both Ext4 and F2FS. Hence to > > remove duplicity, this commit moves the code into > > includ

Re: [f2fs-dev] [PATCH V2 03/13] fsverity: Add call back to decide if verity check has to be performed

2019-05-01 Thread Chandan Rajendra
On Wednesday, May 1, 2019 2:40:38 AM IST Jeremy Sowden wrote: > On 2019-04-28, at 10:01:11 +0530, Chandan Rajendra wrote: > > Ext4 and F2FS store verity metadata in data extents (beyond > > inode->i_size) associated with a file. But other filesystems might > > choose al

Re: [f2fs-dev] [PATCH V2 11/13] ext4: Compute logical block and the page range to be encrypted

2019-05-01 Thread Chandan Rajendra
On Tuesday, April 30, 2019 10:31:51 PM IST Eric Biggers wrote: > On Sun, Apr 28, 2019 at 10:01:19AM +0530, Chandan Rajendra wrote: > > For subpage-sized blocks, the initial logical block number mapped by a > > page can be different from page->index. Hence this commit adds c

Re: [f2fs-dev] [PATCH V2 10/13] fscrypt_encrypt_page: Loop across all blocks mapped by a page range

2019-05-01 Thread Chandan Rajendra
On Wednesday, May 1, 2019 4:38:41 AM IST Eric Biggers wrote: > On Tue, Apr 30, 2019 at 10:11:35AM -0700, Eric Biggers wrote: > > On Sun, Apr 28, 2019 at 10:01:18AM +0530, Chandan Rajendra wrote: > > > For subpage-sized blocks, this commit now encrypts all blocks mapped by

Re: [f2fs-dev] [PATCH V2 10/13] fscrypt_encrypt_page: Loop across all blocks mapped by a page range

2019-05-01 Thread Chandan Rajendra
On Thursday, May 2, 2019 3:59:01 AM IST Eric Biggers wrote: > Hi Chandan, > > On Wed, May 01, 2019 at 08:19:35PM +0530, Chandan Rajendra wrote: > > On Wednesday, May 1, 2019 4:38:41 AM IST Eric Biggers wrote: > > > On Tue, Apr 30, 2019 at 10:11:35AM -0700, Eric Biggers wr

Re: [f2fs-dev] [PATCH 08/13] fscrypt: introduce fscrypt_decrypt_block_inplace()

2019-05-06 Thread Chandan Rajendra
ument. It also makes it so > that all callers have to provide inode and lblk_num, when fscrypt could > determine these itself for pagecache pages. > > Therefore, move the FS_CFLG_OWN_PAGES behavior into a new function > fscrypt_decrypt_block_inplace(). > Looks good to m

Re: [f2fs-dev] [PATCH 07/13] fscrypt: handle blocksize < PAGE_SIZE in fscrypt_zeroout_range()

2019-05-06 Thread Chandan Rajendra
n again this function > already wasn't optimized for performance. As a future optimization, we > could submit much larger bios here. > > This is in preparation for allowing encryption on ext4 filesystems with > blocksize != PAGE_SIZE. > > This is based on work by Chand

Re: [f2fs-dev] [PATCH 13/13] ext4: encrypt only up to last block in ext4_bio_write_page()

2019-05-06 Thread Chandan Rajendra
n ext4 filesystems with > blocksize != PAGE_SIZE. > > This is based on work by Chandan Rajendra. > Looks good to me, Reviewed-by: Chandan Rajendra -- chandan ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH 09/13] fscrypt: support decrypting multiple filesystem blocks per page

2019-05-06 Thread Chandan Rajendra
with > blocksize != PAGE_SIZE. > > This is based on work by Chandan Rajendra. Looks good to me, Reviewed-by: Chandan Rajendra -- chandan ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 05/13] fscrypt: introduce fscrypt_encrypt_block_inplace()

2019-05-06 Thread Chandan Rajendra
ument. It also makes it so > that all callers have to provide inode and lblk_num, when fscrypt could > determine these itself for pagecache pages. > > Therefore, move the FS_CFLG_OWN_PAGES behavior into a new function > fscrypt_encrypt_block_inplace(). Looks good to me, Reviewed-by:

Re: [f2fs-dev] [PATCH 06/13] fscrypt: support encrypting multiple filesystem blocks per page

2019-05-06 Thread Chandan Rajendra
with > blocksize != PAGE_SIZE. > > This is based on work by Chandan Rajendra. Looks good to me, Reviewed-by: Chandan Rajendra -- chandan ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 04/13] fscrypt: clean up some BUG_ON()s in block encryption/decryption

2019-05-06 Thread Chandan Rajendra
both encryption and > decryption, not just encryption. Looks good to me, Reviewed-by: Chandan Rajendra -- chandan ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 02/13] fscrypt: remove the "write" part of struct fscrypt_ctx

2019-05-02 Thread Chandan Rajendra
On Thursday, May 2, 2019 4:15:04 AM IST Eric Biggers wrote: > From: Eric Biggers > > Now that fscrypt_ctx is not used for writes, remove the 'w' fields. > Looks good to me, Reviewed-by: Chandan Rajendra -- chandan ___ Linux-f2fs-d

Re: [f2fs-dev] [PATCH 01/13] fscrypt: simplify bounce page handling

2019-05-02 Thread Chandan Rajendra
refore, this patch makes this change. In the process, it also cleans > up the API exposed to filesystems that allows testing whether a page is > a bounce page, getting the pagecache page from a bounce page, and > freeing a bounce page. Looks good to me,

Re: [f2fs-dev] [PATCH 03/13] fscrypt: rename fscrypt_do_page_crypto() to fscrypt_crypt_block()

2019-05-02 Thread Chandan Rajendra
a "page" per se. To > reflect this, rename it to fscrypt_crypt_block(). > Looks good to me, Reviewed-by: Chandan Rajendra -- chandan ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

[f2fs-dev] [PATCH V2 06/13] ext4: Wire up ext4_readpage[s] to use mpage_readpage[s]

2019-04-27 Thread Chandan Rajendra
Now that do_mpage_readpage() is "post read process" aware, this commit gets ext4_readpage[s] to use mpage_readpage[s] and deletes ext4's readpage.c since the associated functionality is not required anymore. Signed-off-by: Chandan Rajendra --- fs/ext4/Makefile | 2 +- fs/ex

[f2fs-dev] [PATCH V2 01/13] ext4: Clear BH_Uptodate flag on decryption error

2019-04-27 Thread Chandan Rajendra
On an error return from fscrypt_decrypt_page(), ext4_block_write_begin() can return with the page's buffer_head marked with BH_Uptodate flag. This commit clears the BH_Uptodate flag in such cases. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 8 ++-- 1 file changed, 6 insertions

[f2fs-dev] [PATCH V2 02/13] Consolidate "read callbacks" into a new file

2019-04-27 Thread Chandan Rajendra
and fsverity sources. With these in place, the read callbacks code now has to just invoke enqueue functions provided by fscrypt and fsverity. Signed-off-by: Chandan Rajendra --- fs/Kconfig | 4 + fs/Makefile| 4 + fs/crypto/Kconfig | 1 + fs/crypto/bio.c

[f2fs-dev] [PATCH V2 08/13] ext4: Decrypt all boundary blocks when doing buffered write

2019-04-27 Thread Chandan Rajendra
With subpage sized blocks, ext4_block_write_begin() can have up to two blocks to decrypt. Hence this commit invokes fscrypt_decrypt_page() for each of those blocks. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 33 +++-- 1 file changed, 23 insertions(+), 10

[f2fs-dev] [PATCH V2 04/13] fsverity: Add call back to determine readpage limit

2019-04-27 Thread Chandan Rajendra
() to read files having verity metadata appended beyond i_size. Signed-off-by: Chandan Rajendra --- fs/ext4/super.c | 17 + include/linux/fsverity.h | 1 + 2 files changed, 18 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 63d73b360f1d..8e483afba

[f2fs-dev] [PATCH V2 00/13] Consolidate FS read I/O callbacks code

2019-04-27 Thread Chandan Rajendra
ents of a page holding a verity file's data needs to be verified. RFC V1 -> RFC V2: 1. Describe the purpose of "Post processing code" in the cover letter. 2. Fix build errors when CONFIG_FS_VERITY is enabled. Chandan Rajendra (13): ext4: Clear BH_Uptodate flag on decryption error Cons

[f2fs-dev] [PATCH V2 05/13] fs/mpage.c: Integrate read callbacks

2019-04-27 Thread Chandan Rajendra
rivate indicates that after the read operation is performed, the bio's payload needs to be processed further before handing over the data to user space. The context structure is used for tracking the state machine associated with post read processing. Signed-off-by: Chandan Rajendra ---

[f2fs-dev] [PATCH V2 13/13] ext4: Enable encryption for subpage-sized blocks

2019-04-27 Thread Chandan Rajendra
less than page size now works. Signed-off-by: Chandan Rajendra --- Documentation/filesystems/fscrypt.rst | 4 ++-- fs/ext4/super.c | 7 --- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Documentation/filesystems/fscrypt.rst b/Documentation/filesystems

[f2fs-dev] [PATCH V2 11/13] ext4: Compute logical block and the page range to be encrypted

2019-04-27 Thread Chandan Rajendra
For subpage-sized blocks, the initial logical block number mapped by a page can be different from page->index. Hence this commit adds code to compute the first logical block mapped by the page and also the page range to be encrypted. Signed-off-by: Chandan Rajendra --- fs/ext4/page-io.c

[f2fs-dev] [PATCH V2 07/13] Add decryption support for sub-pagesized blocks

2019-04-27 Thread Chandan Rajendra
n. Signed-off-by: Chandan Rajendra --- fs/buffer.c| 83 +- fs/crypto/bio.c| 50 +--- fs/crypto/crypto.c | 19 +++- fs/f2fs/data.c | 2 +- fs/mpage.c |

[f2fs-dev] [PATCH V2 03/13] fsverity: Add call back to decide if verity check has to be performed

2019-04-27 Thread Chandan Rajendra
ity operation needs to performed against a page-cache page holding file data. Signed-off-by: Chandan Rajendra --- fs/ext4/super.c | 6 ++ fs/f2fs/super.c | 6 ++ fs/read_callbacks.c | 4 +++- include/linux/fsverity.h | 1 + 4 files changed, 16 insertions(+), 1 delet

[f2fs-dev] [PATCH V2 10/13] fscrypt_encrypt_page: Loop across all blocks mapped by a page range

2019-04-27 Thread Chandan Rajendra
For subpage-sized blocks, this commit now encrypts all blocks mapped by a page range. Signed-off-by: Chandan Rajendra --- fs/crypto/crypto.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index

[f2fs-dev] [PATCH V2 09/13] ext4: Decrypt the block that needs to be partially zeroed

2019-04-27 Thread Chandan Rajendra
__ext4_block_zero_page_range decrypts the entire page. This commit decrypts the block to be partially zeroed instead of the whole page. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c

[f2fs-dev] [PATCH V2 12/13] fscrypt_zeroout_range: Encrypt all zeroed out blocks of a page

2019-04-27 Thread Chandan Rajendra
For subpage-sized blocks, this commit adds code to encrypt all zeroed out blocks mapped by a page. Signed-off-by: Chandan Rajendra --- fs/crypto/bio.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c

Re: [f2fs-dev] [PATCH V1 02/14] Consolidate "post read processing" into a new file

2019-04-24 Thread Chandan Rajendra
On Wednesday, April 24, 2019 5:36:46 PM IST Jaegeuk Kim wrote: > On 04/24, Chandan Rajendra wrote: > > On Wednesday, April 24, 2019 2:01:26 PM IST Jaegeuk Kim wrote: > > > Hi Chandan, > > > > > > On 04/24, Chandan Rajendra wrote: > > > > The post re

Re: [f2fs-dev] [PATCH V1 02/14] Consolidate "post read processing" into a new file

2019-04-24 Thread Chandan Rajendra
On Wednesday, April 24, 2019 7:54:23 PM IST Christoph Hellwig wrote: > On Wed, Apr 24, 2019 at 03:34:17PM +0530, Chandan Rajendra wrote: > > To clarify, Are you suggesting that a new kconfig option (say > > CONFIG_FS_READ_CALLBACKS) be provided to the user so that the follo

[f2fs-dev] [PATCH V1 01/14] ext4: Clear BH_Uptodate flag on decryption error

2019-04-23 Thread Chandan Rajendra
On an error return from fscrypt_decrypt_page(), ext4_block_write_begin() can return with the page's buffer_head marked with BH_Uptodate flag. This commit clears the BH_Uptodate flag in such cases. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 8 ++-- 1 file changed, 6 insertions

[f2fs-dev] [PATCH V1 03/14] fsverity: Add call back to decide if verity check has to be performed

2019-04-23 Thread Chandan Rajendra
ity operation needs to performed against a page-cache page holding file data. Signed-off-by: Chandan Rajendra --- fs/ext4/super.c | 6 ++ fs/f2fs/super.c | 6 ++ fs/post_read_process.c | 4 +++- include/linux/fsverity.h | 1 + 4 files changed, 16 insertions(+), 1 delet

[f2fs-dev] [PATCH V1 09/14] ext4: Decrypt all boundary blocks when doing buffered write

2019-04-23 Thread Chandan Rajendra
With subpage sized blocks, ext4_block_write_begin() can have up to two blocks to decrypt. Hence this commit invokes fscrypt_decrypt_page() for each of those blocks. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 33 +++-- 1 file changed, 23 insertions(+), 10

[f2fs-dev] [PATCH V1 00/14] Consolidate Post read processing code

2019-04-23 Thread Chandan Rajendra
fstests on UBIFS. 2. Implement F2fs function call back to check if the contents of a page holding a verity file's data needs to be verified. RFC V1 -> RFC V2: 1. Describe the purpose of "Post processing code" in the cover letter. 2. Fix build errors when CONFIG_FS_VERITY is enabled. Chan

[f2fs-dev] [PATCH V1 08/14] Add decryption support for sub-pagesized blocks

2019-04-23 Thread Chandan Rajendra
ecrypting each block in turn. Signed-off-by: Chandan Rajendra --- fs/buffer.c | 83 +++ fs/crypto/bio.c | 50 +-- fs/crypto/crypto.c| 19 ++- fs/f2fs/data.c

[f2fs-dev] [PATCH V1 11/14] fscrypt_encrypt_page: Loop across all blocks mapped by a page range

2019-04-23 Thread Chandan Rajendra
For subpage-sized blocks, this commit now encrypts all blocks mapped by a page range. Signed-off-by: Chandan Rajendra --- fs/crypto/crypto.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index

[f2fs-dev] [PATCH V1 14/14] ext4: Enable encryption for subpage-sized blocks

2019-04-23 Thread Chandan Rajendra
less than page size now works. Signed-off-by: Chandan Rajendra --- Documentation/filesystems/fscrypt.rst | 4 ++-- fs/ext4/super.c | 7 --- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Documentation/filesystems/fscrypt.rst b/Documentation/filesystems

[f2fs-dev] [PATCH V1 12/14] ext4: Compute logical block and the page range to be encrypted

2019-04-23 Thread Chandan Rajendra
For subpage-sized blocks, the initial logical block number mapped by a page can be different from page->index. Hence this commit adds code to compute the first logical block mapped by the page and also the page range to be encrypted. Signed-off-by: Chandan Rajendra --- fs/ext4/page-io.c

[f2fs-dev] [PATCH V1 13/14] fscrypt_zeroout_range: Encrypt all zeroed out blocks of a page

2019-04-23 Thread Chandan Rajendra
For subpage-sized blocks, this commit adds code to encrypt all zeroed out blocks mapped by a page. Signed-off-by: Chandan Rajendra --- fs/crypto/bio.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c

[f2fs-dev] [PATCH V1 07/14] Remove the term "bio" from post read processing

2019-04-23 Thread Chandan Rajendra
For block size < page size, apart from handling bios, post read processing needs to handle buffer heads. Hence this commit removes the term "bio" from the identifiers associated with post read processing. Signed-off-by: Chandan Rajendra --- fs/crypto/bio.c | 6

[f2fs-dev] [PATCH V1 10/14] ext4: Decrypt the block that needs to be partially zeroed

2019-04-23 Thread Chandan Rajendra
__ext4_block_zero_page_range decrypts the entire page. This commit decrypts the block to be partially zeroed instead of the whole page. Signed-off-by: Chandan Rajendra --- fs/ext4/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c

Re: [f2fs-dev] [PATCH V1 02/14] Consolidate "post read processing" into a new file

2019-04-24 Thread Chandan Rajendra
On Wednesday, April 24, 2019 11:05:44 AM IST Christoph Hellwig wrote: > On Wed, Apr 24, 2019 at 10:07:18AM +0530, Chandan Rajendra wrote: > > +ifeq (y, $(firstword $(filter y,$(CONFIG_FS_ENCRYPTION) > > $(CONFIG_FS_VERITY > > +obj-y += post_read_process.o > >

[f2fs-dev] [PATCH V1 04/14] fsverity: Add call back to determine readpage limit

2019-04-23 Thread Chandan Rajendra
() to read files having verity metadata appended beyond i_size. Signed-off-by: Chandan Rajendra --- fs/ext4/super.c | 17 + include/linux/fsverity.h | 1 + 2 files changed, 18 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 63d73b360f1d..8e483afba

[f2fs-dev] [PATCH V1 02/14] Consolidate "post read processing" into a new file

2019-04-23 Thread Chandan Rajendra
ty sources. With these in place, the post processing code now has to just invoke enqueue functions provided by fscrypt and fsverity. Signed-off-by: Chandan Rajendra --- fs/Makefile | 4 + fs/crypto/bio.c | 23 ++-- fs/crypto/crypto.c| 17 +--

[f2fs-dev] [PATCH V1 06/14] ext4: Wire up ext4_readpage[s] to use mpage_readpage[s]

2019-04-23 Thread Chandan Rajendra
Now that do_mpage_readpage() is "post read process" aware, this commit gets ext4_readpage[s] to use mpage_readpage[s] and deletes ext4's readpage.c since the associated functionality is not required anymore. Signed-off-by: Chandan Rajendra --- fs/ext4/Makefile | 2 +- fs/ex

[f2fs-dev] [PATCH V1 05/14] fs/mpage.c: Integrate post read processing

2019-04-23 Thread Chandan Rajendra
rivate indicates that after the read operation is performed, the bio's payload needs to be processed further before handing over the data to user space. The context structure is used for tracking the state machine associated with post read processing. Signed-off-by: Chandan Rajendra ---

[f2fs-dev] [PATCH V4 0/8] Consolidate FS read I/O callbacks code

2019-08-16 Thread Chandan Rajendra
FLG_OWN_PAGES subset of fscrypt_encrypt_page() code by executing fstests on UBIFS. 2. Implement F2fs function call back to check if the contents of a page holding a verity file's data needs to be verified. RFC V1 -> RFC V2: 1. Describe the purpose of "Post processing code" in the cover le

[f2fs-dev] [PATCH V4 6/8] ext4: Wire up ext4_readpage[s] to use mpage_readpage[s]

2019-08-16 Thread Chandan Rajendra
Now that do_mpage_readpage() is "post read process" aware, this commit gets ext4_readpage[s] to use mpage_readpage[s] and deletes ext4's readpage.c since the associated functionality is not required anymore. --- fs/ext4/Makefile | 2 +- fs/ext4/inode.c| 5 +- fs/ext4/readpage.c | 295

[f2fs-dev] [PATCH V4 2/8] FS: Introduce read callbacks

2019-08-16 Thread Chandan Rajendra
by the endio function associated with the read operation. Signed-off-by: Chandan Rajendra --- fs/Kconfig | 3 + fs/Makefile| 1 + fs/ext4/Kconfig| 1 + fs/f2fs/Kconfig| 1 + fs/read_callbacks.c| 285

[f2fs-dev] [PATCH V4 4/8] fs/buffer.c: add decryption support via read_callbacks

2019-08-16 Thread Chandan Rajendra
This commit sets up read_callbacks context for buffer heads whose contents need to be decrypted on endio. Signed-off-by: Chandan Rajendra --- fs/buffer.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[f2fs-dev] [PATCH V4 7/8] ext4: Enable encryption for subpage-sized blocks

2019-08-16 Thread Chandan Rajendra
less than page size now works. Signed-off-by: Chandan Rajendra --- Documentation/filesystems/fscrypt.rst | 4 ++-- fs/ext4/super.c | 7 --- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Documentation/filesystems/fscrypt.rst b/Documentation/filesystems

[f2fs-dev] [PATCH V4 3/8] fs/mpage.c: Integrate read callbacks

2019-08-16 Thread Chandan Rajendra
underlying disk. Signed-off-by: Chandan Rajendra --- fs/mpage.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 3f19da75178b..65e7165644e2 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -30,6 +30,7 @@ #include #include

[f2fs-dev] [PATCH V4 5/8] f2fs: Use read_callbacks for decrypting file data

2019-08-16 Thread Chandan Rajendra
F2FS has a copy of "post read processing" code using which encrypted file data is decrypted. This commit replaces it to make use of the generic read_callbacks facility. Signed-off-by: Chandan Rajendra --- fs/f2fs/data.c | 109 fs/f

[f2fs-dev] [PATCH V4 8/8] fscrypt: remove struct fscrypt_ctx

2019-08-16 Thread Chandan Rajendra
tructure and the associated code. While at it, this commit also removes definitions of __fscrypt_decrypt_bio() and fscrypt_decrypt_bio() since we have to now use the APIs provided by read_callbacks facility. Signed-off-by: Chandan Rajendra --- fs/crypto/bio.c | 43

[f2fs-dev] [PATCH V4 1/8] buffer_head: Introduce BH_Read_Cb flag

2019-08-16 Thread Chandan Rajendra
g generic/475 test case. Hence this commit introduces a new buffer head flag to reliably check for decryption of a buffer head's contents after the block has been read from the disk. Signed-off-by: Chandan Rajendra --- include/linux/buffer_head.h | 2 ++ 1 file changed, 2 insertions(+) diff --g

Re: [f2fs-dev] [PATCH V4 5/8] f2fs: Use read_callbacks for decrypting file data

2019-08-19 Thread Chandan Rajendra
On Friday, August 16, 2019 11:48 AM Chandan Rajendra wrote: > F2FS has a copy of "post read processing" code using which encrypted > file data is decrypted. This commit replaces it to make use of the > generic read_callbacks facility. > > Signed-off-by: Chandan Rajendra

Re: [f2fs-dev] [PATCH V4 5/8] f2fs: Use read_callbacks for decrypting file data

2019-08-19 Thread Chandan Rajendra
On Sunday, August 18, 2019 7:15:42 PM IST Chao Yu wrote: > Hi Chandan, > > On 2019-8-16 14:18, Chandan Rajendra wrote: > > F2FS has a copy of "post read processing" code using which encrypted > > file data is decrypted. This commit replaces it to make use of

Re: [f2fs-dev] [PATCH V4 5/8] f2fs: Use read_callbacks for decrypting file data

2019-08-20 Thread Chandan Rajendra
On Tuesday, August 20, 2019 11:01 PM Jaegeuk Kim wrote: > Hi Chandan, > > On 08/20, Theodore Y. Ts'o wrote: > > On Tue, Aug 20, 2019 at 10:35:29AM +0530, Chandan Rajendra wrote: > > > Looks like F2FS requires a lot more flexiblity than what can be offered by

<    1   2