Re: [f2fs-dev] [PATCH v2] f2fs: separate NOCoW and pinfile semantics

2019-07-31 Thread Chao Yu
On 2019/7/31 2:02, Jaegeuk Kim wrote: > On 07/29, Chao Yu wrote: >> On 2019/7/29 13:57, Jaegeuk Kim wrote: >>> On 07/23, Chao Yu wrote: On 2019/7/23 10:36, Jaegeuk Kim wrote: > On 07/19, Chao Yu wrote: >> Pinning a file is heavy, because skipping pinned files make GC >> running wit

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

2019-07-31 Thread Chao Yu
On 2019/7/31 7:18, Jaegeuk Kim wrote: > On 07/29, Chao Yu wrote: >> From: Chao Yu >> >> Later after this patch was merged, all new incompatible feature's >> bit should be added into sb.required_features field, and define new >> feature function with F2FS_INCOMPAT_FEATURE_FUNCS() macro. >> >> Then

Re: [f2fs-dev] [PATCH] f2fs: fix memory leak in build_directory

2019-07-31 Thread Chao Yu
On 2019/7/31 11:27, Xiaojun Wang wrote: > This patch fix bug that variable dentries going > out of scope leaks the storage it points to. Normally, we use title like "sload.f2fs: xxx" to indicate this is a patch of f2fs-tools, otherwise it looks like a kernel one. It's local filesystem change, so

Re: [f2fs-dev] [PATCH] f2fs: Fix indefinite loop in f2fs_gc()

2019-07-31 Thread Chao Yu
Hi Sahitya, On 2019/7/31 11:41, Sahitya Tummala wrote: > Hi Chao, > > On Tue, Jul 30, 2019 at 08:35:46PM +0800, Chao Yu wrote: >> Hi Sahitya, >> >> On 2019/7/30 12:36, Sahitya Tummala wrote: >>> Hi Chao, >>> >>> On Tue, Jul 30, 2019 at 12:00:45AM +0800, Chao Yu wrote: Hi Sahitya, O

[f2fs-dev] [PATCH] sload.f2fs: fix to set temperature during sload

2019-07-31 Thread Chao Yu
This patch enable to set file's temperature while loading files to image. Signed-off-by: Chao Yu --- fsck/dir.c | 51 ++ include/f2fs_fs.h | 1 + mkfs/f2fs_format.c | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/fsck/

[f2fs-dev] [PATCH] fsck.f2fs: include f2fs_fs.h from local directory

2019-07-31 Thread Chao Yu
f2fs_fs.h locats in local directory rather than system one, fix it. Signed-off-by: Chao Yu --- fsck/f2fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index 21d4c33..a52b5d4 100644 --- a/fsck/f2fs.h +++ b/fsck/f2fs.h @@ -11,7 +11,6 @@ #ifndef

[f2fs-dev] [PATCH v13 0/5] overlayfs override_creds=off

2019-07-31 Thread Mark Salyzyn via Linux-f2fs-devel
Patch series: overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh Add flags option to get xattr method paired to __vfs_getxattr overlayfs: handle XATTR_NOSECURITY flag for get xattr method overlayfs: internal getxattr operations without sepolicy checking overlayfs: override_cred

[f2fs-dev] [PATCH v13 1/5] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh

2019-07-31 Thread Mark Salyzyn via Linux-f2fs-devel
Assumption never checked, should fail if the mounter creds are not sufficient. Signed-off-by: Mark Salyzyn Cc: Miklos Szeredi Cc: Jonathan Corbet Cc: Vivek Goyal Cc: Eric W. Biederman Cc: Amir Goldstein Cc: Randy Dunlap Cc: Stephen Smalley Cc: linux-unio...@vger.kernel.org Cc: linux-...@vg

[f2fs-dev] [PATCH v13 4/5] overlayfs: internal getxattr operations without sepolicy checking

2019-07-31 Thread Mark Salyzyn via Linux-f2fs-devel
Check impure, opaque, origin & meta xattr with no sepolicy audit (using __vfs_getxattr) since these operations are internal to overlayfs operations and do not disclose any data. This became an issue for credential override off since sys_admin would have been required by the caller; whereas would h

[f2fs-dev] [PATCH v13 5/5] overlayfs: override_creds=off option bypass creator_cred

2019-07-31 Thread Mark Salyzyn via Linux-f2fs-devel
By default, all access to the upper, lower and work directories is the recorded mounter's MAC and DAC credentials. The incoming accesses are checked against the caller's credentials. If the principles of least privilege are applied, the mounter's credentials might not overlap the credentials of t

[f2fs-dev] [PATCH v13 0/5] overlayfs override_creds=off

2019-07-31 Thread Mark Salyzyn via Linux-f2fs-devel
Patch series: overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh Add flags option to get xattr method paired to __vfs_getxattr overlayfs: handle XATTR_NOSECURITY flag for get xattr method overlayfs: internal getxattr operations without sepolicy checking overlayfs: override_cred

[f2fs-dev] [PATCH v13 2/5] Add flags option to get xattr method paired to __vfs_getxattr

2019-07-31 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 data that is th

[f2fs-dev] [PATCH v13 3/5] overlayfs: handle XATTR_NOSECURITY flag for get xattr method

2019-07-31 Thread Mark Salyzyn via Linux-f2fs-devel
Because of the overlayfs getxattr recursion, the incoming inode fails to update the selinux sid resulting in avc denials being reported against a target context of u:object_r:unlabeled:s0. Solution is to respond to the XATTR_NOSECURITY flag in get xattr method that calls the __vfs_getxattr handler

Re: [f2fs-dev] [PATCH v4 3/3] f2fs: Support case-insensitive file name lookups

2019-07-31 Thread Nathan Chancellor
Hi all, > diff --git a/fs/f2fs/hash.c b/fs/f2fs/hash.c > index cc82f142f811f..99e79934f5088 100644 > --- a/fs/f2fs/hash.c > +++ b/fs/f2fs/hash.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > > #include "f2fs.h" > > @@ -67,7 +68,7 @@ static void str2hashbuf(const

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

2019-07-31 Thread Eric Biggers
On Mon, Jul 29, 2019 at 12:58:28PM -0700, Eric Biggers wrote: > On Sun, Jul 28, 2019 at 03:24:17PM -0400, Theodore Y. Ts'o wrote: > > > + > > > +/* > > > + * Try to remove an fscrypt master encryption key. If other users have > > > also > > > + * added the key, we'll remove the current user's usa

[PATCH] f2fs: fix livelock in swapfile writes

2019-07-31 Thread Jaegeuk Kim
This patch fixes livelock in the below call path when writing swap pages. [46374.617256] c2701 __switch_to+0xe4/0x100 [46374.617265] c2701 __schedule+0x80c/0xbc4 [46374.617273] c2701 schedule+0x74/0x98 [46374.617281] c2701 rwsem_down_read_failed+0x190/0x234 [46374.617291] c2

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

2019-07-31 Thread Theodore Y. Ts'o
On Wed, Jul 31, 2019 at 11:38:02AM -0700, Eric Biggers wrote: > > This is perhaps different from what users expect from unlink(). It's well > known > that unlink() just deletes the filename, not the file itself if it's still > open > or has other links. And unlink() by itself isn't meant for u

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

2019-07-31 Thread Eric Biggers
On Wed, Jul 31, 2019 at 07:38:43PM -0400, Theodore Y. Ts'o wrote: > On Wed, Jul 31, 2019 at 11:38:02AM -0700, Eric Biggers wrote: > > > > This is perhaps different from what users expect from unlink(). It's well > > known > > that unlink() just deletes the filename, not the file itself if it's s

Re: [f2fs-dev] [PATCH v4 3/3] f2fs: Support case-insensitive file name lookups

2019-07-31 Thread Chao Yu
Hi Nathan, Thanks for the report! :) On 2019/8/1 1:57, Nathan Chancellor wrote: > Hi all, > > > >> diff --git a/fs/f2fs/hash.c b/fs/f2fs/hash.c >> index cc82f142f811f..99e79934f5088 100644 >> --- a/fs/f2fs/hash.c >> +++ b/fs/f2fs/hash.c >> @@ -14,6 +14,7 @@ >> #include >> #include >> #inc

[f2fs-dev] [f2fs-tools][PATCH] Throw an error when zone device info not found

2019-07-31 Thread Surbhi Palande
From: Surbhi Palande When the -m option is specified to format a Zoned device, do not fall back to the non-zoned mode in case information about the device is not found. Explicitly specify this error to the user. Signed-off-by: Surbhi Palande --- lib/libf2fs.c | 8 +++- 1 file changed, 7 i

Re: [f2fs-dev] [f2fs-tools][PATCH] Throw an error when zone device info not found

2019-07-31 Thread Chao Yu
Hi Surbhi, This patch looks good to me, unless we'd better change patch title a little as "libf2fs: throw an " to indicate which part of f2fs we patched. Anyway, please add below tag in your next version: Reviewed-by: Chao Yu BTW, I notice that your name of email address is cool! Very suit

Re: [f2fs-dev] [PATCH] f2fs: fix livelock in swapfile writes

2019-07-31 Thread Chao Yu
On 2019/8/1 4:43, Jaegeuk Kim wrote: > This patch fixes livelock in the below call path when writing swap pages. > > [46374.617256] c2701 __switch_to+0xe4/0x100 > [46374.617265] c2701 __schedule+0x80c/0xbc4 > [46374.617273] c2701 schedule+0x74/0x98 > [46374.617281] c2701 rwsem_

Re: [f2fs-dev] [f2fs-tools][PATCH] Throw an error when zone device info not found

2019-07-31 Thread Damien Le Moal
On 2019/08/01 10:26, Surbhi Palande wrote: > From: Surbhi Palande > > When the -m option is specified to format a Zoned device, > do not fall back to the non-zoned mode in case information > about the device is not found. > > Explicitly specify this error to the user. > > Signed-off-by: Surbhi

Re: [f2fs-dev] [PATCH v4 3/3] f2fs: Support case-insensitive file name lookups

2019-07-31 Thread Jaegeuk Kim
On 08/01, Chao Yu wrote: > Hi Nathan, > > Thanks for the report! :) > > On 2019/8/1 1:57, Nathan Chancellor wrote: > > Hi all, > > > > > > > >> diff --git a/fs/f2fs/hash.c b/fs/f2fs/hash.c > >> index cc82f142f811f..99e79934f5088 100644 > >> --- a/fs/f2fs/hash.c > >> +++ b/fs/f2fs/hash.c > >> @

Re: [PATCH v2] f2fs: separate NOCoW and pinfile semantics

2019-07-31 Thread Jaegeuk Kim
On 07/31, Chao Yu wrote: > On 2019/7/31 2:02, Jaegeuk Kim wrote: > > On 07/29, Chao Yu wrote: > >> On 2019/7/29 13:57, Jaegeuk Kim wrote: > >>> On 07/23, Chao Yu wrote: > On 2019/7/23 10:36, Jaegeuk Kim wrote: > > On 07/19, Chao Yu wrote: > >> Pinning a file is heavy, because skipping

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

2019-07-31 Thread Jaegeuk Kim
On 07/31, Chao Yu wrote: > On 2019/7/31 7:18, Jaegeuk Kim wrote: > > On 07/29, Chao Yu wrote: > >> From: Chao Yu > >> > >> Later after this patch was merged, all new incompatible feature's > >> bit should be added into sb.required_features field, and define new > >> feature function with F2FS_INCO

Re: [f2fs-dev] [PATCH] f2fs: fix livelock in swapfile writes

2019-07-31 Thread Jaegeuk Kim
On 08/01, Chao Yu wrote: > On 2019/8/1 4:43, Jaegeuk Kim wrote: > > This patch fixes livelock in the below call path when writing swap pages. > > > > [46374.617256] c2701 __switch_to+0xe4/0x100 > > [46374.617265] c2701 __schedule+0x80c/0xbc4 > > [46374.617273] c2701 schedule+0x74/0x

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

2019-07-31 Thread Theodore Y. Ts'o
On Wed, Jul 31, 2019 at 06:11:40PM -0700, Eric Biggers wrote: > > Well, it's either > > 1a. Remove the user's handle. > OR > 1b. Remove all users' handles. (FSCRYPT_REMOVE_KEY_FLAG_ALL_USERS) > > Then > > 2. If no handles remain, try to evict all inodes that use the key. > > By "purge