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

2019-07-29 Thread Sahitya Tummala
Hi Chao, On Tue, Jul 30, 2019 at 12:00:45AM +0800, Chao Yu wrote: > Hi Sahitya, > > On 2019-7-29 13:20, Sahitya Tummala wrote: > > Policy - foreground GC, LFS mode and greedy GC mode. > > > > Under this policy, f2fs_gc() loops forever to GC as it doesn't have > > enough free segements to

[f2fs-dev] [Bug 204135] F2FS: BUG: KASAN: null-ptr-deref in mempool_alloc+0xd8/0x2e0

2019-07-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204135 --- Comment #6 from midwinter1...@gmail.com --- (In reply to Chao Yu from comment #5) > Sorry, I meant I made the two fix patches based Jaegeuk's git repo, however > Jaegeuk hasn't merge the two patches in his branch. > > So you can do the merge

[f2fs-dev] [Bug 204043] F2fs kernel BUG at fs/f2fs/data.c:317!

2019-07-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204043 Chao Yu (c...@kernel.org) changed: What|Removed |Added Status|ASSIGNED|RESOLVED

[f2fs-dev] [Bug 204043] F2fs kernel BUG at fs/f2fs/data.c:317!

2019-07-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204043 --- Comment #10 from midwinter1...@gmail.com --- (In reply to Chao Yu from comment #8) > This bug was reported by you in another track... > > So could you confirm the issue in this track again? Sorry! I forgot that bug. I have tested the patch

[f2fs-dev] [PATCH 00/20] vfs: Add support for timestamp limits

2019-07-29 Thread Deepa Dinamani
The series is an update and a more complete version of the previously posted series at https://lore.kernel.org/linux-fsdevel/20180122020426.2988-1-deepa.ker...@gmail.com/ Thanks to Arnd Bergmann for doing a few preliminary reviews. They helped me fix a few issues I had overlooked. The limits

[PATCH 03/20] timestamp_truncate: Replace users of timespec64_trunc

2019-07-29 Thread Deepa Dinamani
Update the inode timestamp updates to use timestamp_truncate() instead of timespec64_trunc(). The change was mostly generated by the following coccinelle script. virtual context virtual patch @r1 depends on patch forall@ struct inode *inode; identifier i_xtime =~ "^i_[acm]time$"; expression e;

Re: [f2fs-dev] [PATCH v7 15/16] ubifs: wire up new fscrypt ioctls

2019-07-29 Thread Theodore Y. Ts'o
On Fri, Jul 26, 2019 at 03:41:40PM -0700, Eric Biggers wrote: > From: Eric Biggers > > Wire up the new ioctls for adding and removing fscrypt keys to/from the > filesystem, and the new ioctl for retrieving v2 encryption policies. > > FS_IOC_REMOVE_ENCRYPTION_KEY also required making UBIFS use >

Re: [f2fs-dev] [PATCH v7 14/16] f2fs: wire up new fscrypt ioctls

2019-07-29 Thread Jaegeuk Kim
On 07/26, Eric Biggers wrote: > From: Eric Biggers > > Wire up the new ioctls for adding and removing fscrypt keys to/from the > filesystem, and the new ioctl for retrieving v2 encryption policies. > > FS_IOC_REMOVE_ENCRYPTION_KEY also required making f2fs_drop_inode() call >

Re: [f2fs-dev] [PATCH v7 09/16] fscrypt: add an HKDF-SHA512 implementation

2019-07-29 Thread James Bottomley
On Mon, 2019-07-29 at 13:29 -0700, Eric Biggers wrote: > On Sun, Jul 28, 2019 at 03:39:49PM -0400, Theodore Y. Ts'o wrote: > > On Fri, Jul 26, 2019 at 03:41:34PM -0700, Eric Biggers wrote: > > > From: Eric Biggers [...] > > > HKDF solves all the above problems. > > > > > > Signed-off-by: Eric

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

2019-07-29 Thread Eric Biggers
On Sun, Jul 28, 2019 at 10:00:09PM -0400, Theodore Y. Ts'o wrote: > On Fri, Jul 26, 2019 at 03:41:41PM -0700, Eric Biggers wrote: > > +- The kernel cannot magically wipe copies of the master key(s) that > > + userspace might have as well. Therefore, userspace must wipe all > > + copies of the

Re: [f2fs-dev] [PATCH v7 10/16] fscrypt: v2 encryption policy support

2019-07-29 Thread Eric Biggers
On Sun, Jul 28, 2019 at 05:17:30PM -0400, Theodore Y. Ts'o wrote: > On Fri, Jul 26, 2019 at 03:41:35PM -0700, Eric Biggers wrote: > > @@ -319,6 +329,31 @@ int fscrypt_ioctl_add_key(struct file *filp, void > > __user *_uarg) > > if (!capable(CAP_SYS_ADMIN)) > > goto

Re: [f2fs-dev] [PATCH v7 09/16] fscrypt: add an HKDF-SHA512 implementation

2019-07-29 Thread Eric Biggers
On Sun, Jul 28, 2019 at 03:39:49PM -0400, Theodore Y. Ts'o wrote: > On Fri, Jul 26, 2019 at 03:41:34PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > Add an implementation of HKDF (RFC 5869) to fscrypt, for the purpose of > > deriving additional key material from the fscrypt master

Re: [f2fs-dev] [PATCH v7 06/16] fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl

2019-07-29 Thread Theodore Y. Ts'o
On Mon, Jul 29, 2019 at 12:46:45PM -0700, Eric Biggers wrote: > > For that matter, we could just add a new ioctl which returns the file > > system's keyring id. That way an application program won't have to > > try to figure out what a file's underlying sb->s_id happens to be. > > (Especially if

Re: [f2fs-dev] [PATCH v7 06/16] fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl

2019-07-29 Thread Eric Biggers
On Sun, Jul 28, 2019 at 02:50:03PM -0400, Theodore Y. Ts'o wrote: > On Fri, Jul 26, 2019 at 03:41:31PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > Add a new fscrypt ioctl, FS_IOC_ADD_ENCRYPTION_KEY. This ioctl adds an > > encryption key to the filesystem's fscrypt keyring

Re: [f2fs-dev] [PATCH v7 05/16] fscrypt: refactor v1 policy key setup into keysetup_legacy.c

2019-07-29 Thread Eric Biggers
Hi Ted, thanks for the review! On Sun, Jul 28, 2019 at 11:40:32AM -0400, Theodore Y. Ts'o wrote: > On Fri, Jul 26, 2019 at 03:41:30PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > In preparation for introducing v2 encryption policies which will find > > and derive encryption keys

[f2fs-dev] kernel BUG at fs/f2fs/segment.c:2391 during xfstest generic/204

2019-07-29 Thread Eric Biggers
On xfstest generic/204 on f2fs, I'm getting a kernel BUG. It bisects to: commit 1cb50f87e10696e8cc61fb62d0d948e11b0e6dc1 Author: Jaegeuk Kim Date: Fri Jul 6 16:47:34 2018 -0700 f2fs: do checkpoint in kill_sb Here is the BUG, on v5.3-rc2: generic/204 1s

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

2019-07-29 Thread Chao Yu
Hi Sahitya, On 2019-7-29 13:20, Sahitya Tummala wrote: > Policy - foreground GC, LFS mode and greedy GC mode. > > Under this policy, f2fs_gc() loops forever to GC as it doesn't have > enough free segements to proceed and thus it keeps calling gc_more > for the same victim segment. This can

[f2fs-dev] [PATCH] dump.f2fs: allow to dump data on mounted device

2019-07-29 Thread Chao Yu
From: Chao Yu In generic/38[3456], we use quotactl(2) to check if prjquota is enabled on the given device (src/feature -P $dev in _require_prjquota), and quotactl(2) requires the given device is a mounted device. So it requires dump.f2fs to list/check enabled features on a mounted device, let's

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

2019-07-29 Thread Chao Yu
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 during mount, we will do sanity check with enabled features in image, if there are

[f2fs-dev] [PATCH RESEND] f2fs: fix to migrate blocks correctly during defragment

2019-07-29 Thread Chao Yu
From: Chao Yu During defragment, we missed to trigger fragmented blocks migration for below condition: In defragment region: - total number of valid blocks is smaller than 512; - the tail part of the region are all holes; In addtion, return zero to user via range->len if there is no fragmented

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

2019-07-29 Thread Chao Yu
On 2019-7-29 15:22, Chao Yu wrote: > On 2019/7/29 14:27, Jaegeuk Kim wrote: >> On 07/28, Chao Yu wrote: >>> On 2019-7-24 7:05, Daniel Rosenberg via Linux-f2fs-devel wrote: /* Flags that are appropriate for regular files (all but dir-specific ones). */ #define F2FS_REG_FLMASK

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

2019-07-29 Thread Chao Yu
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 during mount, we will do sanity check with enabled features in image, if there are

[f2fs-dev] [PATCH] f2fs: fix to migrate blocks correctly during defragment

2019-07-29 Thread Chao Yu
From: Chao Yu During defragment, we missed to trigger fragmented blocks migration for below condition: In defragment region: - total number of valid blocks is smaller than 512; - the tail part of the region are all holes; In addtion, return zero to user via range->len if there is no fragmented

[f2fs-dev] [PATCH] common/quota: enable project quota correctly on f2fs

2019-07-29 Thread Chao Yu
Add a case for f2fs on _scratch_enable_pquota() to enable dependent features of project quota by mkfs. Signed-off-by: Chao Yu --- common/quota | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/quota b/common/quota index 659c6219..38aa9470 100644 ---

Re: [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount

2019-07-29 Thread Chao Yu
On 2019/7/28 17:51, Eryu Guan wrote: > On Tue, Jul 23, 2019 at 05:25:27PM +0800, Chao Yu wrote: >> Move _require_prjquota() to front of _qmount() since we do the >> check on device directly instead of mountpoint, it can avoid >> potential failure if filesystem utils needs exclusive open on >>

[PATCH v2] f2fs: fix to do sanity with enabled features in image

2019-07-29 Thread 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 during mount, we will do sanity check with enabled features in image, if there are features in

Re: [f2fs-dev] [PATCH] f2fs: use kmem_cache pool during xattr lookups

2019-07-29 Thread Ju Hyung Park
Hi Chao and Jaegeuk, I have no idea how that patch got merged. We(me and Yaro) were supposed to work on doing some finishing touches to the patch before sending it to upstream. I'll personally check with Yaro. Jaegeuk, please remove the patch. That patch has numerous issues, biggest one being

Re: [f2fs-dev] [PATCH] f2fs: use kmem_cache pool during xattr lookups

2019-07-29 Thread Chao Yu
Hi Jaegeuk, Ju Hyung, Yaroslav, I can see "f2fs: xattr: reserve cache for xattr allocations" has been merged in dev-test branch, however, it doesn't exist in f2fs mailing list, so I can not comment on it Can anyone send it to the list? Thanks,

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

2019-07-29 Thread Chao Yu
On 2019/7/29 14:27, Jaegeuk Kim wrote: > On 07/28, Chao Yu wrote: >> On 2019-7-24 7:05, Daniel Rosenberg via Linux-f2fs-devel wrote: >>> /* Flags that are appropriate for regular files (all but dir-specific >>> ones). */ >>> #define F2FS_REG_FLMASK(~(F2FS_DIRSYNC_FL | >>>

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

2019-07-29 Thread Chao Yu
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 with heavy load or no effect. >>> >>> Pinned file is a part of NOCOW files, so I

Re: [f2fs-dev] [PATCH v2] f2fs: fix to read source block before invalidating it

2019-07-29 Thread Chao Yu
On 2019/7/29 13:54, Jaegeuk Kim wrote: > On 07/23, Chao Yu wrote: >> On 2019/7/23 9:27, Jaegeuk Kim wrote: >>> On 07/18, Chao Yu wrote: On 2019/7/18 12:00, Jaegeuk Kim wrote: > On 07/18, Chao Yu wrote: >> On 2019/7/18 11:12, Jaegeuk Kim wrote: >>> f2fs_allocate_data_block()

Re: [f2fs-dev] [PATCH] f2fs: fix to do sanity with enabled features in image

2019-07-29 Thread Chao Yu
On 2019/7/29 13:47, Jaegeuk Kim wrote: > On 07/23, Chao Yu wrote: >> On 2019/7/23 9:35, Jaegeuk Kim wrote: >>> On 07/16, Chao Yu wrote: Hi Jaegeuk, On 2019/5/9 9:15, Chao Yu wrote: > On 2019/5/5 10:51, Chao Yu wrote: >> On 2019/5/1 11:22, Jaegeuk Kim wrote: >>> On 04/29,

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

2019-07-29 Thread Jaegeuk Kim
On 07/28, Chao Yu wrote: > On 2019-7-24 7:05, Daniel Rosenberg via Linux-f2fs-devel wrote: > > /* Flags that are appropriate for regular files (all but dir-specific > > ones). */ > > #define F2FS_REG_FLMASK(~(F2FS_DIRSYNC_FL | > > F2FS_PROJINHERIT_FL)) > > We missed to add