Re: [PATCH v3 RESEND] f2fs: introduce sb.required_features to store incompatible features

2019-08-12 Thread Chao Yu
On 2019/8/9 23:26, Jaegeuk Kim wrote: > On 08/06, Chao Yu wrote: >> On 2019/8/6 10:11, Jaegeuk Kim wrote: >>> On 08/06, Chao Yu wrote: On 2019/8/6 9:24, Jaegeuk Kim wrote: > On 08/06, Chao Yu wrote: >> On 2019/8/6 8:35, Jaegeuk Kim wrote: >>> On 08/02, Chao Yu wrote: On

[f2fs-dev] [PATCH 2/4] fsck.f2fs: fix to check c.fix_on before repair

2019-08-12 Thread Chao Yu
We should always set c.bug_on whenever found a bug, then fix them if c.fix_on is on, otherwise, some bugs won't be shown unless we enable debug log. Signed-off-by: Chao Yu --- fsck/fsck.c | 137 +++- 1 file changed, 83 insertions(+), 54 deletions(-

[f2fs-dev] [PATCH 3/4] fsck.f2fs: fix to show removed x_nid correctly

2019-08-12 Thread Chao Yu
Otherwise, we just show fixed zero x_nid value. Signed-off-by: Chao Yu --- fsck/fsck.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 91ddd49..1ea8590 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -659,6 +659,7 @@ void fsck_chk_inode_b

[f2fs-dev] [PATCH 4/4] fsck.f2fs: fix symlink correctly

2019-08-12 Thread Chao Yu
inode.i_blocks includes inode, xnode and data block count, so, only fix in below condition: - i_blocks := 3 (inode + xnode + data_block) - i_blocks := 2 (inode + data_block) In addition, it recovers symlink's i_size to 4k rather than i_blocks * 4k. Signed-off-by: Chao Yu --- fsck/fsck.c | 9 +++

[f2fs-dev] [PATCH 1/4] fsck.f2fs: fix to recover out-of-border inline size

2019-08-12 Thread Chao Yu
It tries to let fsck be noticed wrong inline size, and do the fix. Signed-off-by: Chao Yu --- fsck/fsck.c | 8 1 file changed, 8 insertions(+) diff --git a/fsck/fsck.c b/fsck/fsck.c index d53317c..7eb599d 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -771,6 +771,8 @@ void fsck_chk_inod

[f2fs-dev] f2fs_symlink bug

2019-08-12 Thread Chao Yu
Hi Jaegeuk, In por_fsstress testcase, fsck reports below inconsistent status, I found one path can cause this case. [FIX] (fsck_chk_inode_blk:1002) --> Symlink: recover 0x1425 with i_size=4096 [ASSERT] (fsck_chk_inode_blk:1030) --> ino: 0x1425 chksum:0x6983d47, but calculated one is: 0xdb284b35

Re: [f2fs-dev] [PATCH 6/6] f2fs: use EFSCORRUPTED in f2fs_get_verity_descriptor()

2019-08-12 Thread Chao Yu
On 2019/8/12 5:35, Eric Biggers wrote: > From: Eric Biggers > > EFSCORRUPTED is now defined in f2fs.h, so use it instead of EUCLEAN. > > Signed-off-by: Eric Biggers Acked-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lis

Re: [f2fs-dev] [PATCH 3/6] f2fs: skip truncate when verity in progress in ->write_begin()

2019-08-12 Thread Chao Yu
Hi Eric, On 2019/8/12 5:35, Eric Biggers wrote: > From: Eric Biggers > > When an error (e.g. ENOSPC) occurs during f2fs_write_begin() when called > from f2fs_write_merkle_tree_block(), skip truncating the file. i_size > is not meaningful in this case, and the truncation is handled by > f2fs_end

Re: [f2fs-dev] [PATCH v7 07/16] fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY ioctl

2019-08-12 Thread Theodore Y. Ts'o
On Thu, Aug 01, 2019 at 09:38:27PM -0700, Eric Biggers wrote: > > Here's a slightly updated version (I missed removing some stale text): Apologies for the delaying in getting back. Thanks, this looks great. - Ted > > Removing keys > - >

[f2fs-dev] [PATCH] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-12 Thread Mark Salyzyn via Linux-f2fs-devel
Add a flag option to get xattr method that could have a bit flag of XATTR_NOSECURITY passed to it. XATTR_NOSECURITY is generally then set in the __vfs_getxattr path. This handles the case of a union filesystem driver that is being requested by the security layer to report back the xattr data. Fo

Re: [f2fs-dev] [PATCH v8 05/20] fscrypt: rename fscrypt_master_key to fscrypt_direct_key

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:06AM -0700, Eric Biggers wrote: > From: Eric Biggers > > In preparation for introducing a filesystem-level keyring which will > contain fscrypt master keys, rename the existing 'struct > fscrypt_master_key' to 'struct fscrypt_direct_key'. This is the > structure in

Re: [f2fs-dev] [PATCH v8 06/20] fscrypt: refactor key setup code in preparation for v2 policies

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:07AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Do some more refactoring of the key setup code, in preparation for > introducing a filesystem-level keyring and v2 encryption policies: > > - Now that ci_inode exists, don't pass around the inode unnecessarily

[f2fs-dev] [PATCH 1/2] mkfs.f2fs: add "zip" to cold data types

2019-08-12 Thread Park Ju Hyung
A lot of Linux users have big, cold "zip" files. Signed-off-by: Park Ju Hyung --- mkfs/f2fs_format.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 9402619..37d82c3 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -66,6 +66,7 @@ const

[f2fs-dev] [PATCH 2/2] mkfs.f2fs: add VM disk files to hot data types

2019-08-12 Thread Park Ju Hyung
Similar to .db files, these are randomly updated extremely frequently. Signed-off-by: Park Ju Hyung --- mkfs/f2fs_format.c | 5 + 1 file changed, 5 insertions(+) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 37d82c3..1c08e3e 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_forma

Re: [f2fs-dev] [PATCH v8 08/20] fscrypt: rename keyinfo.c to keysetup.c

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:09AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Rename keyinfo.c to keysetup.c since this better describes what the file > does (sets up the key), and it matches the new file keysetup_v1.c. > > Signed-off-by: Eric Biggers Looks good, you can add: Reviewe

Re: [f2fs-dev] [PATCH v8 07/20] fscrypt: move v1 policy key setup to keysetup_v1.c

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:08AM -0700, Eric Biggers wrote: > From: Eric Biggers > > In preparation for introducing v2 encryption policies which will find > and derive encryption keys differently from the current v1 encryption > policies, move the v1 policy-specific key setup code from keyinfo.

Re: [f2fs-dev] [PATCH 3/6] f2fs: skip truncate when verity in progress in ->write_begin()

2019-08-12 Thread Eric Biggers
Hi Chao, On Mon, Aug 12, 2019 at 08:25:33PM +0800, Chao Yu wrote: > Hi Eric, > > On 2019/8/12 5:35, Eric Biggers wrote: > > From: Eric Biggers > > > > When an error (e.g. ENOSPC) occurs during f2fs_write_begin() when called > > from f2fs_write_merkle_tree_block(), skip truncating the file. i_s

Re: [f2fs-dev] [PATCH v8 10/20] fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY ioctl

2019-08-12 Thread Theodore Y. Ts'o
> + /* Some inodes still reference this key; try to evict them. */ > + if (try_to_lock_encrypted_files(sb, mk) != 0) > + status_flags |= > + FSCRYPT_KEY_REMOVAL_STATUS_FLAG_FILES_BUSY; > + } try_to_lock_encrypted_files() c

Re: [f2fs-dev] [PATCH v8 14/20] fscrypt: allow unprivileged users to add/remove keys for v2 policies

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:15AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Allow the FS_IOC_ADD_ENCRYPTION_KEY and FS_IOC_REMOVE_ENCRYPTION_KEY > ioctls to be used by non-root users to add and remove encryption keys > from the filesystem-level crypto keyrings, subject to limitations.

Re: [f2fs-dev] [PATCH v8 15/20] fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS ioctl

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:16AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Add a root-only variant of the FS_IOC_REMOVE_ENCRYPTION_KEY ioctl which > removes all users' claims of the key, not just the current user's claim. > I.e., it always removes the key itself, no matter how many us

Re: [f2fs-dev] [PATCH v8 13/20] fscrypt: v2 encryption policy support

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:14AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Add a new fscrypt policy version, "v2". It has the following changes > from the original policy version, which we call "v1" (*): > > - Master keys (the user-provided encryption keys) are only ever used as >

Re: [f2fs-dev] [PATCH v8 20/20] fscrypt: document the new ioctls and policy version

2019-08-12 Thread Theodore Y. Ts'o
On Mon, Aug 05, 2019 at 09:25:21AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Update the fscrypt documentation file to catch up to all the latest > changes, including the new ioctls to manage master encryption keys in > the filesystem-level keyring and the support for v2 encryption polic

Re: [f2fs-dev] [PATCH 3/6] f2fs: skip truncate when verity in progress in ->write_begin()

2019-08-12 Thread Chao Yu
Hi Eric, On 2019/8/13 6:58, Eric Biggers wrote: > Hi Chao, > > On Mon, Aug 12, 2019 at 08:25:33PM +0800, Chao Yu wrote: >> Hi Eric, >> >> On 2019/8/12 5:35, Eric Biggers wrote: >>> From: Eric Biggers >>> >>> When an error (e.g. ENOSPC) occurs during f2fs_write_begin() when called >>> from f2fs_w