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 wrote: > > > > On Sun, Apr

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

2019-05-01 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] [PATCH 09/13] fscrypt: support decrypting multiple filesystem blocks per page

2019-05-01 Thread Eric Biggers
From: Eric Biggers Rename fscrypt_decrypt_page() to fscrypt_decrypt_pagecache_blocks() and redefine its behavior to decrypt all filesystem blocks in the given region of the given page, rather than assuming that the region consists of just one filesystem block. Also remove the 'inode' and

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers Rename fscrypt_encrypt_page() to fscrypt_encrypt_pagecache_blocks() and redefine its behavior to encrypt all filesystem blocks from the given region of the given page, rather than assuming that the region consists of just one filesystem block. Also remove the 'inode' and

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers Now that fscrypt_ctx is not used for writes, remove the 'w' fields. Signed-off-by: Eric Biggers --- fs/crypto/bio.c | 11 +-- fs/crypto/crypto.c | 14 +++--- include/linux/fscrypt.h | 7 ++- 3 files changed, 14 insertions(+), 18

[f2fs-dev] [PATCH 10/13] ext4: clear BH_Uptodate flag on decryption error

2019-05-01 Thread Eric Biggers
From: Chandan Rajendra If decryption fails, ext4_block_write_begin() can return with the page's buffer_head marked with the BH_Uptodate flag. This commit clears the BH_Uptodate flag in such cases. Signed-off-by: Chandan Rajendra Signed-off-by: Eric Biggers --- fs/ext4/inode.c | 8 ++--

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers As an optimization, don't encrypt blocks fully beyond i_size, since those definitely won't need to be written out. Also add a comment. This is in preparation for allowing encryption on ext4 filesystems with blocksize != PAGE_SIZE. This is based on work by Chandan Rajendra.

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers fscrypt_do_page_crypto() only does a single encryption or decryption operation, with a single logical block number (single IV). So it actually operates on a filesystem block, not a "page" per se. To reflect this, rename it to fscrypt_crypt_block(). Signed-off-by: Eric

[f2fs-dev] [PATCH 12/13] ext4: decrypt only the needed block in __ext4_block_zero_page_range()

2019-05-01 Thread Eric Biggers
From: Chandan Rajendra In __ext4_block_zero_page_range(), only decrypt the block that actually needs to be decrypted, rather than assuming blocksize == PAGE_SIZE and decrypting the whole page. This is in preparation for allowing encryption on ext4 filesystems with blocksize != PAGE_SIZE.

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers Replace some BUG_ON()s with WARN_ON_ONCE() and returning an error code, and move the check for len divisible by FS_CRYPTO_BLOCK_SIZE into fscrypt_crypt_block() so that it's done for both encryption and decryption, not just encryption. Signed-off-by: Eric Biggers ---

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers fscrypt_decrypt_page() behaves very differently depending on whether the filesystem set FS_CFLG_OWN_PAGES in its fscrypt_operations. This makes the function difficult to understand and document. It also makes it so that all callers have to provide inode and lblk_num, when

[f2fs-dev] [PATCH 00/13] fscrypt, ext4: prepare for blocksize != PAGE_SIZE

2019-05-01 Thread Eric Biggers
Hello, This patch series prepares fs/crypto/, and partially ext4, for the 'blocksize != PAGE_SIZE' case. This basically contains the encryption changes from Chandan Rajendra's patch series "[V2,00/13] Consolidate FS read I/O callbacks code"

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers fscrypt_encrypt_page() behaves very differently depending on whether the filesystem set FS_CFLG_OWN_PAGES in its fscrypt_operations. This makes the function difficult to understand and document. It also makes it so that all callers have to provide inode and lblk_num, when

[f2fs-dev] [PATCH 11/13] ext4: decrypt only the needed blocks in ext4_block_write_begin()

2019-05-01 Thread Eric Biggers
From: Chandan Rajendra In ext4_block_write_begin(), only decrypt the blocks that actually need to be decrypted (up to two blocks which intersect the boundaries of the region that will be written to), rather than assuming blocksize == PAGE_SIZE and decrypting the whole page. This is in

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers Currently, bounce page handling for writes to encrypted files is unnecessarily complicated. A fscrypt_ctx is allocated along with each bounce page, page_private(bounce_page) points to this fscrypt_ctx, and fscrypt_ctx::w::control_page points to the original pagecache page.

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

2019-05-01 Thread Eric Biggers
From: Eric Biggers Adjust fscrypt_zeroout_range() to encrypt a block at a time rather than a page at a time, so that it works when blocksize < PAGE_SIZE. This isn't optimized for performance, but then again this function already wasn't optimized for performance. As a future optimization, we

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

2019-05-01 Thread Eric Biggers
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 wrote: > > > On Sun, Apr 28, 2019 at 10:01:18AM +0530, Chandan Rajendra wrote: > > > > For

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 > > > a page range. > > >

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 code to > > compute the

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_callbacks.h and fs/read_callbacks.c. > > > >

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 the code into > >

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". > > 2. Pass buffer head

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 alternative means to store

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 > > include/linux/read_callbacks.h and

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: Chandan Rajendra > > --- > >

[f2fs-dev] [f2fs:dev 37/39] include/trace/events/f2fs.h:1287:1: sparse: sparse: cast from restricted vm_fault_t

2019-05-01 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev head: f8484026e829f44d3836054534c59bf7937ba864 commit: c632dd40b9cf038245195e9e54db4a816088ccb5 [37/39] f2fs: add tracepoint for f2fs_filemap_fault() reproduce: # apt-get install sparse git checkout