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

2019-04-27 Thread Chandan Rajendra
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 do_mpage_readpge() to make use of the functionality provided. "FS read I/O callbacks" code implements the state machine that needs to be executed after reading data from

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

2019-04-27 Thread Chandan Rajendra
This commit adds code to make do_mpage_readpage() to be "read callbacks" aware i.e. for files requiring decryption/verification, do_mpage_readpage() now allocates a context structure and assigns the corresponding pointer to bio->bi_private. At endio time, a non-zero bio->bi_private indicates that

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

2019-04-27 Thread Chandan Rajendra
Now that we have the code to support encryption for subpage-sized blocks, this commit removes the conditional check in filesystem mount code. The commit also changes the support statement in Documentation/filesystems/fscrypt.rst to reflect the fact that encryption of filesystems with blocksize

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

2019-04-27 Thread Chandan Rajendra
Ext4 and F2FS store verity metadata beyond i_size. This commit adds a call back pointer to "struct fsverity_operations" which helps in determining the the real file size limit upto which data can be read from the file. This call back will be required in order to get do_mpage_readpage() to read

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

2019-04-27 Thread Chandan Rajendra
The "read callbacks" code is used by both Ext4 and F2FS. Hence to remove duplicity, this commit moves the code into include/linux/read_callbacks.h and fs/read_callbacks.c. The corresponding decrypt and verity "work" functions have been moved inside fscrypt and fsverity sources. With these in

[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 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/ext4/inode.c|

[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 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

[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 | 9

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

2019-04-27 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. In the corresponding endio, loop across all the blocks mapped by the page, decrypting each block in turn.

[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
Ext4 and F2FS store verity metadata in data extents (beyond inode->i_size) associated with a file. But other filesystems might choose alternative means to store verity metadata. Hence this commit adds a callback function pointer to 'struct fsverity_operations' to help in deciding if verity

[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

Re: [f2fs-dev] [PATCH] f2fs: Add option to limit required GC for checkpoint=disable

2019-04-27 Thread Chao Yu
Hi Daniel, On 2019/4/24 9:25, Daniel Rosenberg wrote: > This extends the checkpoint option to allow checkpoint=disable:%u > This allows you to specify what percent of the drive you are willing > to lose access to while mounting with checkpoint=disable. If the amount > lost would be higher, the