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

2019-04-23 Thread Christoph Hellwig
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 > +endif Please just add a new config option selected by the users. Also I find the file name rather

[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
This patchset moves the "post read processing" code into a file of its own (i.e. fs/post_read_process.c) and modifies the generic do_mpage_readpge() to make use of the functionality provided. "Post read processing" implements code to track the state machine that needs to be executed after reading

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

2019-04-23 Thread Chandan Rajendra
To support decryption of sub-pagesized blocks this commit adds code to, 1. Track buffer head in "struct post_read_ctx". 2. Pass buffer head argument to all "post read" processing functions. 3. In the corresponding endio, loop across all the blocks mapped by the page, decrypting each block in

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

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

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

2019-04-23 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 V1 02/14] Consolidate "post read processing" into a new file

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

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

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

2019-04-23 Thread Chandan Rajendra
This commit adds code to make do_mpage_readpage() to be "post read processing" 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

[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
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 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 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(+),

Re: [f2fs-dev] [PATCH] f2fs: remove redundant check in f2fs_file_write_iter()

2019-04-23 Thread Chao Yu
On 2019/4/23 13:08, Chengguang Xu wrote: > We have already checked flag IOCB_DIRECT in the sanity > check of flag IOCB_NOWAIT, so don't have to check it > again here. > > Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu Thanks, ___

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

2019-04-23 Thread Daniel Rosenberg via Linux-f2fs-devel
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 mount will return -EAGAIN. Currently, we need to run garbage

[f2fs-dev] [f2fs:dev-test 15/41] include/trace/events/f2fs.h:1287:1: sparse: sparse: cast to restricted vm_fault_t

2019-04-23 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test head: 2f7ea3581030c1a146db350dc5d3bf068861145b commit: 93ed4e0804b3b5e9dc7e2cfe522b0a407ab7198c [15/41] f2fs: add tracepoint for f2fs_filemap_fault() reproduce: # apt-get install sparse git

Re: [f2fs-dev] [PATCH 1/2] f2fs: allow unfixed f2fs_checkpoint.checksum_offset

2019-04-23 Thread Jaegeuk Kim
On 04/23, Jaegeuk Kim wrote: > On 04/22, Chao Yu wrote: > > Previously, f2fs_checkpoint.checksum_offset points fixed position of > > f2fs_checkpoint structure: > > > > "#define CP_CHKSUM_OFFSET 4092" > > > > It is unnecessary, and it breaks the consecutiveness of nat and sit > > bitmap stored

Re: [f2fs-dev] [PATCH 1/2] f2fs: allow unfixed f2fs_checkpoint.checksum_offset

2019-04-23 Thread Jaegeuk Kim
On 04/22, Chao Yu wrote: > Previously, f2fs_checkpoint.checksum_offset points fixed position of > f2fs_checkpoint structure: > > "#define CP_CHKSUM_OFFSET 4092" > > It is unnecessary, and it breaks the consecutiveness of nat and sit > bitmap stored across checkpoint park block and payload

Re: [f2fs-dev] Possible issues with fsck of f2fs root

2019-04-23 Thread Hagbard Celine
2019-04-23 4:55 GMT+02:00, Chao Yu : > On 2019/4/22 18:05, Hagbard Celine wrote: >> 2019-04-22 11:26 GMT+02:00, Chao Yu : >>> On 2019/4/22 17:05, Hagbard Celine wrote: 2019-04-22 9:37 GMT+02:00, Chao Yu : > On 2019/4/22 15:11, Hagbard Celine wrote: >> With this patch the one problem

Re: [f2fs-dev] Possible issues with fsck of f2fs root

2019-04-23 Thread Hagbard Celine
2019-04-23 13:59 GMT+02:00, Hagbard Celine : > 2019-04-23 4:55 GMT+02:00, Chao Yu : >> On 2019/4/22 18:05, Hagbard Celine wrote: >>> 2019-04-22 11:26 GMT+02:00, Chao Yu : On 2019/4/22 17:05, Hagbard Celine wrote: > 2019-04-22 9:37 GMT+02:00, Chao Yu : >> On 2019/4/22 15:11, Hagbard

Re: [f2fs-dev] Possible issues with fsck of f2fs root

2019-04-23 Thread Hagbard Celine
2019-04-23 4:55 GMT+02:00, Chao Yu : > On 2019/4/22 18:05, Hagbard Celine wrote: >> 2019-04-22 11:26 GMT+02:00, Chao Yu : >>> On 2019/4/22 17:05, Hagbard Celine wrote: 2019-04-22 9:37 GMT+02:00, Chao Yu : > On 2019/4/22 15:11, Hagbard Celine wrote: >> With this patch the one problem