[f2fs-dev] [PATCH] f2fs: submit cached bio to avoid endless PageWriteback

2018-09-11 Thread Chao Yu
When migrating encrypted block from background GC thread, we only add them into f2fs inner bio cache, but forget to submit the cached bio, it may cause potential deadlock when we are waiting page writebacked, fix it. Signed-off-by: Chao Yu --- fs/f2fs/gc.c | 42 +-

Re: [f2fs-dev] f2fs page flag set with private but page.private pointer is NULL

2018-09-11 Thread Chao Yu
Hi Kassey, I sent a patch to solve potential deadlock, but not sure it can fix your problem, could you try that patch? [PATCH] f2fs: submit cached bio to avoid endless PageWriteback On 2018/9/11 11:03, Kassey wrote: > hi, Jaegeuk: > >we got some easy reproduced issue when doing reboot test.

Re: [f2fs-dev] [PATCH v2] f2fs: surround fault_injection ralted option parsing using CONFIG_F2FS_FAULT_INJECTION

2018-09-11 Thread Chao Yu
On 2018/9/11 7:47, Chengguang Xu wrote: > It's a little bit strange when fault_injection related > options fail with -EINVAL which were already disabled > from config, so surround all fault_injection related option > parsing code using CONFIG_F2FS_FAULT_INJECTION. Meanwhile, > slightly change warni

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: fix setattr project check upon fssetxattr ioctl

2018-09-11 Thread Chao Yu
On 2018/9/11 7:54, Wang Shilong wrote: > From: Wang Shilong > > Currently, project quota could be changed by fssetxattr > ioctl, and existed permission check inode_owner_or_capable() > is obviously not enough, just think that common users could > change project id of file, that could make users t

Re: [f2fs-dev] [PATCH v2 3/5] f2fs: cache NULL when both default_acl and acl are NULL

2018-09-11 Thread Jaegeuk Kim
Hi, Let me queue this patch in my -next. Thanks, On 09/02, Chao Yu wrote: > On 2018/8/31 22:33, Chengguang Xu wrote: > > default_acl and acl of newly created inode will be initiated > > as ACL_NOT_CACHED in vfs function inode_init_always() and later > > will be updated by calling xxx_init_acl()

[f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Jaegeuk Kim
fsck.f2fs is able to recover the quota structure, since roll-forward recovery can recover it based on previous user information. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 95511ed11a22..1f

Re: [f2fs-dev] [PATCH v3] f2fs: avoid sleeping under spin_lock

2018-09-11 Thread Jaegeuk Kim
On 09/10, Chao Yu wrote: > On 2018/9/10 16:18, Zhikang Zhang wrote: > > In the call trace below, we might sleep in function dput(). > > > > So in order to avoid sleeping under spin_lock, we remove > > f2fs_mark_inode_dirty_sync > > from __try_update_largest_extent && __drop_largest_extent. > > >

Re: [f2fs-dev] [PATCH v2] f2fs: add new idle interval timing for discard and gc paths

2018-09-11 Thread Jaegeuk Kim
On 09/11, Chao Yu wrote: > On 2018/9/10 11:47, Sahitya Tummala wrote: > > This helps to control the frequency of submission of discard and > > GC requests independently, based on the need. The sleep timing of > > GC thread is now aligned with this idle time when the dev is busy, > > to avoid unnece

Re: [f2fs-dev] [RFC PATCH v3 3/5] f2fs-tools: unify the writeback of superblock

2018-09-11 Thread Jaegeuk Kim
On 09/11, Junling Zheng wrote: > Hi, Jaegeuk > > On 2018/9/11 10:43, Junling Zheng wrote: > > On 2018/9/8 6:23, Jaegeuk Kim wrote: > >> On 08/30, Junling Zheng wrote: > >>> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > >>> index 38a0da4..df46950 100644 > >>> --- a/include/f2fs_fs.h > >>> ++

Re: [f2fs-dev] [PATCH] f2fs: submit cached bio to avoid endless PageWriteback

2018-09-11 Thread Jaegeuk Kim
On 09/11, Chao Yu wrote: > When migrating encrypted block from background GC thread, we only add > them into f2fs inner bio cache, but forget to submit the cached bio, it > may cause potential deadlock when we are waiting page writebacked, fix > it. > > Signed-off-by: Chao Yu > --- > fs/f2fs/gc.

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: fix setattr project check upon fssetxattr ioctl

2018-09-11 Thread Jaegeuk Kim
On 09/11, Wang Shilong wrote: > From: Wang Shilong > > Currently, project quota could be changed by fssetxattr > ioctl, and existed permission check inode_owner_or_capable() > is obviously not enough, just think that common users could > change project id of file, that could make users to > break

Re: [f2fs-dev] [PATCH] f2fs: submit cached bio to avoid endless PageWriteback

2018-09-11 Thread Chao Yu
Jaegeuk, Could you update dev-test branch? so I can rebase this on yours, there are some pending patches in my tree, I guess it can avoid conflict when you merge this. On 2018/9/12 6:39, Jaegeuk Kim wrote: > On 09/11, Chao Yu wrote: >> When migrating encrypted block from background GC thread, we

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Chao Yu
On 2018/9/12 4:15, Jaegeuk Kim wrote: > fsck.f2fs is able to recover the quota structure, since roll-forward recovery > can recover it based on previous user information. I didn't get it, both fsck and kernel recover quota file based all inodes' uid/gid/prjid, if {x}id didn't change, wouldn't thos

[f2fs-dev] [PATCH v4 3/3] f2fs: fix setattr project check upon fssetxattr ioctl

2018-09-11 Thread Wang Shilong
From: Wang Shilong Currently, project quota could be changed by fssetxattr ioctl, and existed permission check inode_owner_or_capable() is obviously not enough, just think that common users could change project id of file, that could make users to break project quota easily. This patch try to fo

[f2fs-dev] [PATCH v2 2/3] ext4: fix to detect failure of dquot_initialize in project ioctl

2018-09-11 Thread Wang Shilong
From: Wang Shilong We return most failure of dquota_initialize() except inode evict, this could make a bit sense, for example we allow file removal even quota files are broken? But it dosen't make sense to allow setting project if quota files etc are broken. Signed-off-by: Wang Shilong --- v1-

[f2fs-dev] [PATCH v3 1/3] ext4: fix setattr project check upon fssetxattr ioctl

2018-09-11 Thread Wang Shilong
From: Wang Shilong Currently, project quota could be changed by fssetxattr ioctl, and existed permission check inode_owner_or_capable() is obviously not enough, just think that common users could change project id of file, that could make users to break project quota easily. This patch try to fo

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > On 2018/9/12 4:15, Jaegeuk Kim wrote: > > fsck.f2fs is able to recover the quota structure, since roll-forward > > recovery > > can recover it based on previous user information. > > I didn't get it, both fsck and kernel recover quota file based all inodes' > uid/gid/pr

Re: [f2fs-dev] [PATCH] f2fs: submit cached bio to avoid endless PageWriteback

2018-09-11 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > Jaegeuk, > > Could you update dev-test branch? so I can rebase this on yours, there are > some > pending patches in my tree, I guess it can avoid conflict when you merge this. Done. > > On 2018/9/12 6:39, Jaegeuk Kim wrote: > > On 09/11, Chao Yu wrote: > >> When migr

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: fix setattr project check upon fssetxattr ioctl

2018-09-11 Thread Wang Shilong
> 在 2018年9月12日,上午6:47,Jaegeuk Kim 写道: > > On 09/11, Wang Shilong wrote: >> From: Wang Shilong >> >> Currently, project quota could be changed by fssetxattr >> ioctl, and existed permission check inode_owner_or_capable() >> is obviously not enough, just think that common users could >> change

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Jaegeuk Kim
On 09/11, Jaegeuk Kim wrote: > On 09/12, Chao Yu wrote: > > On 2018/9/12 4:15, Jaegeuk Kim wrote: > > > fsck.f2fs is able to recover the quota structure, since roll-forward > > > recovery > > > can recover it based on previous user information. > > > > I didn't get it, both fsck and kernel recove

Re: [f2fs-dev] [PATCH] f2fs: submit cached bio to avoid endless PageWriteback

2018-09-11 Thread Chao Yu
Thank you, ;) On 2018/9/12 8:12, Jaegeuk Kim wrote: > On 09/12, Chao Yu wrote: >> Jaegeuk, >> >> Could you update dev-test branch? so I can rebase this on yours, there are >> some >> pending patches in my tree, I guess it can avoid conflict when you merge >> this. > > Done. > >> >> On 2018/9/1

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Chao Yu
On 2018/9/12 8:27, Jaegeuk Kim wrote: > On 09/11, Jaegeuk Kim wrote: >> On 09/12, Chao Yu wrote: >>> On 2018/9/12 4:15, Jaegeuk Kim wrote: fsck.f2fs is able to recover the quota structure, since roll-forward recovery can recover it based on previous user information. >>> >>> I didn'

[f2fs-dev] [PATCH] f2fs: add SPDX license identifiers

2018-09-11 Thread Chao Yu
Remove the verbose license text from f2fs files and replace them with SPDX tags. This does not change the license of any of the code. Signed-off-by: Chao Yu --- fs/f2fs/acl.c | 5 + fs/f2fs/acl.h | 5 + fs/f2fs/checkpoint.c| 5 + fs/f2fs/data.c | 5 +

[f2fs-dev] [PATCH] f2fs: split IO error injection according to RW

2018-09-11 Thread Chao Yu
This patch adds to support injecting error for write IO, this can simulate IO error like fail_make_request or dm_flakey does. Signed-off-by: Chao Yu --- Documentation/filesystems/f2fs.txt | 3 ++- fs/f2fs/data.c | 10 -- fs/f2fs/f2fs.h | 3 ++- f

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > On 2018/9/12 8:27, Jaegeuk Kim wrote: > > On 09/11, Jaegeuk Kim wrote: > >> On 09/12, Chao Yu wrote: > >>> On 2018/9/12 4:15, Jaegeuk Kim wrote: > fsck.f2fs is able to recover the quota structure, since roll-forward > recovery > can recover it based on pre

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Chao Yu
On 2018/9/12 9:25, Jaegeuk Kim wrote: > On 09/12, Chao Yu wrote: >> On 2018/9/12 8:27, Jaegeuk Kim wrote: >>> On 09/11, Jaegeuk Kim wrote: On 09/12, Chao Yu wrote: > On 2018/9/12 4:15, Jaegeuk Kim wrote: >> fsck.f2fs is able to recover the quota structure, since roll-forward >> re

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Chao Yu
On 2018/9/12 9:40, Chao Yu wrote: > On 2018/9/12 9:25, Jaegeuk Kim wrote: >> On 09/12, Chao Yu wrote: >>> On 2018/9/12 8:27, Jaegeuk Kim wrote: On 09/11, Jaegeuk Kim wrote: > On 09/12, Chao Yu wrote: >> On 2018/9/12 4:15, Jaegeuk Kim wrote: >>> fsck.f2fs is able to recover the quot

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > On 2018/9/12 9:25, Jaegeuk Kim wrote: > > On 09/12, Chao Yu wrote: > >> On 2018/9/12 8:27, Jaegeuk Kim wrote: > >>> On 09/11, Jaegeuk Kim wrote: > On 09/12, Chao Yu wrote: > > On 2018/9/12 4:15, Jaegeuk Kim wrote: > >> fsck.f2fs is able to recover the quota s

Re: [f2fs-dev] [PATCH] f2fs: fix quota info to adjust recovered data

2018-09-11 Thread Chao Yu
On 2018/9/12 10:46, Jaegeuk Kim wrote: > On 09/12, Chao Yu wrote: >> On 2018/9/12 9:25, Jaegeuk Kim wrote: >>> On 09/12, Chao Yu wrote: On 2018/9/12 8:27, Jaegeuk Kim wrote: > On 09/11, Jaegeuk Kim wrote: >> On 09/12, Chao Yu wrote: >>> On 2018/9/12 4:15, Jaegeuk Kim wrote: >>>

[f2fs-dev] [PATCH v3] f2fs: surround fault_injection related option parsing using CONFIG_F2FS_FAULT_INJECTION

2018-09-11 Thread Chengguang Xu
It's a little bit strange when fault_injection related options fail with -EINVAL which were already disabled from config, so surround all fault_injection related option parsing code using CONFIG_F2FS_FAULT_INJECTION. Meanwhile, slightly change warning message to keep consistency with option POSIX_A

[f2fs-dev] [PATCH v2] f2fs: submit cached bio to avoid endless PageWriteback

2018-09-11 Thread Chao Yu
When migrating encrypted block from background GC thread, we only add them into f2fs inner bio cache, but forget to submit the cached bio, it may cause potential deadlock when we are waiting page writebacked, fix it. Signed-off-by: Chao Yu --- v2: - cover node path suggested by Jaegeuk. fs/f2fs