[PATCH] f2fs: expose some sectors to user in inline data or dentry case

2017-10-13 Thread Jaegeuk Kim
If there's some data written through inline data or dentry, we need to shouw st_blocks. This fixes reporting zero blocks even though there is small written data. Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs

Re: [PATCH] f2fs: add bug_on when f2fs_gc even fails to get one victim

2017-10-12 Thread Jaegeuk Kim
> On 2017/10/13 7:23, Jaegeuk Kim wrote: > > Hi Yunlong, > > > > On 10/11, Yunlong Song wrote: > > > This can help us to debug on some corner case. > > > > > > Signed-off-by: Yunlong Song <yunlong.s...@huawei.com> > > > --- >

Re: [PATCH] f2fs: add bug_on when f2fs_gc even fails to get one victim

2017-10-12 Thread Jaegeuk Kim
> On 2017/10/13 7:23, Jaegeuk Kim wrote: > > Hi Yunlong, > > > > On 10/11, Yunlong Song wrote: > > > This can help us to debug on some corner case. > > > > > > Signed-off-by: Yunlong Song > > > --- > > > fs/f2fs/gc.c | 6

[PATCH] f2fs: avoid stale fi->gdirty_list pointer

2017-10-12 Thread Jaegeuk Kim
When doing fault injection test, f2fs_evict_inode() didn't remove gdirty_list which incurs a kernel panic due to wrong pointer access. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c

[PATCH] f2fs: avoid stale fi->gdirty_list pointer

2017-10-12 Thread Jaegeuk Kim
When doing fault injection test, f2fs_evict_inode() didn't remove gdirty_list which incurs a kernel panic due to wrong pointer access. Signed-off-by: Jaegeuk Kim --- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index f6db9d533ca4

Re: [PATCH] f2fs: add bug_on when f2fs_gc even fails to get one victim

2017-10-12 Thread Jaegeuk Kim
Hi Yunlong, On 10/11, Yunlong Song wrote: > This can help us to debug on some corner case. > > Signed-off-by: Yunlong Song > --- > fs/f2fs/gc.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index

Re: [PATCH] f2fs: add bug_on when f2fs_gc even fails to get one victim

2017-10-12 Thread Jaegeuk Kim
Hi Yunlong, On 10/11, Yunlong Song wrote: > This can help us to debug on some corner case. > > Signed-off-by: Yunlong Song > --- > fs/f2fs/gc.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 197ebf4..960503e 100644 > ---

[PATCH] f2fs: return error number for quota_write

2017-10-12 Thread Jaegeuk Kim
This patch returns an error number to quota_write in order for quota to handle it correctly. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/super.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 2feecf

[PATCH] f2fs: return error number for quota_write

2017-10-12 Thread Jaegeuk Kim
This patch returns an error number to quota_write in order for quota to handle it correctly. Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 2feecf5e7f4c..840a0876005b 100644 --- a/fs

[PATCH] f2fs: don't commit quota files

2017-10-10 Thread Jaegeuk Kim
- f2fs_mark_dquot_dirty - dquot_commit - mutex_lock() - f2fs_setattr - dquot_transfer - dqget - dquot_acquire - write_blk - f2fs_quota_write - f2fs_write_begin - mutex(node_change) Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/super.

[PATCH] f2fs: don't commit quota files

2017-10-10 Thread Jaegeuk Kim
- f2fs_mark_dquot_dirty - dquot_commit - mutex_lock() - f2fs_setattr - dquot_transfer - dqget - dquot_acquire - write_blk - f2fs_quota_write - f2fs_write_begin - mutex(node_change) Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 16 +--- 1

[PATCH] f2fs/crypto: drop crypto key at evict_inode only

2017-10-10 Thread Jaegeuk Kim
This patch avoids dropping crypto key in f2fs_drop_inode, so we can guarantee it happens only at evict_inode. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dc05b16df514..f10a1b

[PATCH] f2fs/crypto: drop crypto key at evict_inode only

2017-10-10 Thread Jaegeuk Kim
This patch avoids dropping crypto key in f2fs_drop_inode, so we can guarantee it happens only at evict_inode. Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dc05b16df514..f10a1b1380c2 100644 --- a/fs/f2fs

Re: [f2fs-dev] [PATCH] f2fs: Fix bool initialization/comparison

2017-10-10 Thread Jaegeuk Kim
On 10/09, Chao Yu wrote: > On 2017/10/8 3:30, Joe Perches wrote: > > On Sat, 2017-10-07 at 23:33 +0900, Ju Hyung Park wrote: > >> Isn't this bogus? > >> > >> "bool" type in Linux kernel is a typedef to "_Bool" > >> and true/false is defined as 1 and 0 by enum at include/linux/stddef.h. > > > >

Re: [f2fs-dev] [PATCH] f2fs: Fix bool initialization/comparison

2017-10-10 Thread Jaegeuk Kim
On 10/09, Chao Yu wrote: > On 2017/10/8 3:30, Joe Perches wrote: > > On Sat, 2017-10-07 at 23:33 +0900, Ju Hyung Park wrote: > >> Isn't this bogus? > >> > >> "bool" type in Linux kernel is a typedef to "_Bool" > >> and true/false is defined as 1 and 0 by enum at include/linux/stddef.h. > > > >

[GIT PULL] f2fs fix for v4.14-rc5

2017-10-10 Thread Jaegeuk Kim
Hi Linus, Could you please pull this quick bug fix? Thanks, The following changes since commit e365806ac289457263a133bd32df8df49897f612: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (2017-09-25 18:24:14 -0700) are available in the git repository at:

[GIT PULL] f2fs fix for v4.14-rc5

2017-10-10 Thread Jaegeuk Kim
Hi Linus, Could you please pull this quick bug fix? Thanks, The following changes since commit e365806ac289457263a133bd32df8df49897f612: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (2017-09-25 18:24:14 -0700) are available in the git repository at:

Re: [PATCH 1/6] f2fs: support issuing/waiting discard in range

2017-10-03 Thread Jaegeuk Kim
-discards It seems we need to rearrange some of patches for better review. Thanks, On 10/03, Jaegeuk Kim wrote: > On 09/19, Chao Yu wrote: > > From: Chao Yu <yuch...@huawei.com> > > > > Fstrim intends to trim invalid blocks of filesystem only with specifie

Re: [PATCH 1/6] f2fs: support issuing/waiting discard in range

2017-10-03 Thread Jaegeuk Kim
-discards It seems we need to rearrange some of patches for better review. Thanks, On 10/03, Jaegeuk Kim wrote: > On 09/19, Chao Yu wrote: > > From: Chao Yu > > > > Fstrim intends to trim invalid blocks of filesystem only with specified > > range and granularity, but

Re: [f2fs-dev] [PATCH v4] f2fs: introduce discard_granularity sysfs entry

2017-10-03 Thread Jaegeuk Kim
18 08/11/2017 > >> [26672.553794] task: 8808159c1600 task.stack: 880813304000 > >> [26672.553798] RIP: 0010:__remove_discard_cmd+0x6a/0xd0 > >> [26672.553799] RSP: 0018:880813307e20 EFLAGS: 00010296 > >> [26672.553800] RAX: dead0200 RBX: 88047eeaed00 RC

Re: [f2fs-dev] [PATCH v4] f2fs: introduce discard_granularity sysfs entry

2017-10-03 Thread Jaegeuk Kim
72.553798] RIP: 0010:__remove_discard_cmd+0x6a/0xd0 > >> [26672.553799] RSP: 0018:880813307e20 EFLAGS: 00010296 > >> [26672.553800] RAX: dead0200 RBX: 88047eeaed00 RCX: > >> 8808159c1601 > >> [26672.553801] RDX: dead0100 RSI: 8808134d

Re: [PATCH 1/6] f2fs: support issuing/waiting discard in range

2017-10-03 Thread Jaegeuk Kim
On 09/19, Chao Yu wrote: > From: Chao Yu > > Fstrim intends to trim invalid blocks of filesystem only with specified > range and granularity, but actually, it will issue all previous cached > discard commands which may be out-of-range and be with unmatched > granularity, it's

Re: [PATCH 1/6] f2fs: support issuing/waiting discard in range

2017-10-03 Thread Jaegeuk Kim
On 09/19, Chao Yu wrote: > From: Chao Yu > > Fstrim intends to trim invalid blocks of filesystem only with specified > range and granularity, but actually, it will issue all previous cached > discard commands which may be out-of-range and be with unmatched > granularity, it's unneeded. > > In

Re: [PATCH 1/6] f2fs: support issuing/waiting discard in range

2017-09-26 Thread Jaegeuk Kim
On 09/19, Chao Yu wrote: > From: Chao Yu > > Fstrim intends to trim invalid blocks of filesystem only with specified > range and granularity, but actually, it will issue all previous cached > discard commands which may be out-of-range and be with unmatched > granularity, it's

Re: [PATCH 1/6] f2fs: support issuing/waiting discard in range

2017-09-26 Thread Jaegeuk Kim
On 09/19, Chao Yu wrote: > From: Chao Yu > > Fstrim intends to trim invalid blocks of filesystem only with specified > range and granularity, but actually, it will issue all previous cached > discard commands which may be out-of-range and be with unmatched > granularity, it's unneeded. > > In

Re: [PATCH v3] vfs: introduce UMOUNT_WAIT to wait for delayed_fput/mntput completion

2017-09-21 Thread Jaegeuk Kim
_work(ns1) - put_super(), since sb->s_active = 0 - -EIO Cc: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/file_table.c | 6 ++ fs/namespace.c | 26 +- include/linux/file.h | 1 + include/linu

Re: [PATCH v3] vfs: introduce UMOUNT_WAIT to wait for delayed_fput/mntput completion

2017-09-21 Thread Jaegeuk Kim
_work(ns1) - put_super(), since sb->s_active = 0 - -EIO Cc: Al Viro Signed-off-by: Jaegeuk Kim --- fs/file_table.c | 6 ++ fs/namespace.c | 26 +- include/linux/file.h | 1 + include/linux/fs.h | 1 + 4 files changed, 33 insertions(+)

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-21 Thread Jaegeuk Kim
On 09/21, Theodore Ts'o wrote: > On Wed, Sep 20, 2017 at 10:02:37PM -0700, Jaegeuk Kim wrote: > > > > Yes, and actually, android retries umount(2) for several seconds, if it gets > > failure. So, first I thought it'd be better to make umount() more > > deterministic

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-21 Thread Jaegeuk Kim
On 09/21, Theodore Ts'o wrote: > On Wed, Sep 20, 2017 at 10:02:37PM -0700, Jaegeuk Kim wrote: > > > > Yes, and actually, android retries umount(2) for several seconds, if it gets > > failure. So, first I thought it'd be better to make umount() more > > deterministic

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-20 Thread Jaegeuk Kim
On 09/21, Al Viro wrote: > On Wed, Sep 20, 2017 at 05:34:09PM -0700, Jaegeuk Kim wrote: > > > flush_delayed_fput() > > > does nothing, the list is empty > > > > how about waiting for workqueue completion here? > > > &g

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-20 Thread Jaegeuk Kim
On 09/21, Al Viro wrote: > On Wed, Sep 20, 2017 at 05:34:09PM -0700, Jaegeuk Kim wrote: > > > flush_delayed_fput() > > > does nothing, the list is empty > > > > how about waiting for workqueue completion here? > > > &g

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-20 Thread Jaegeuk Kim
On 09/20, Al Viro wrote: > On Wed, Sep 20, 2017 at 10:38:31AM -0700, Jaegeuk Kim wrote: > > This patch introduces UMOUNT_WAIT flag for umount(2) which let user wait for > > umount(2) to complete filesystem shutdown. This should fix a kernel panic > > triggered when a li

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-20 Thread Jaegeuk Kim
On 09/20, Al Viro wrote: > On Wed, Sep 20, 2017 at 10:38:31AM -0700, Jaegeuk Kim wrote: > > This patch introduces UMOUNT_WAIT flag for umount(2) which let user wait for > > umount(2) to complete filesystem shutdown. This should fix a kernel panic > > triggered when a li

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-20 Thread Jaegeuk Kim
: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/namespace.c | 12 +++- include/linux/fs.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index f8893dc6a989..f2c15c4f6e23 100644 --

Re: [PATCH v2] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-20 Thread Jaegeuk Kim
Viro Signed-off-by: Jaegeuk Kim --- fs/namespace.c | 12 +++- include/linux/fs.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index f8893dc6a989..f2c15c4f6e23 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -21,6 +21,7

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-19 Thread Jaegeuk Kim
On 09/16, Al Viro wrote: > On Fri, Sep 15, 2017 at 04:29:11PM -0700, Jaegeuk Kim wrote: > > > The mntput() in delayed_fput() is the last function call. So before that > > moment, > > sys_umount() may see mnt_get_count() as 2, so it avoids EBUSY condition. > > I'm

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-19 Thread Jaegeuk Kim
On 09/16, Al Viro wrote: > On Fri, Sep 15, 2017 at 04:29:11PM -0700, Jaegeuk Kim wrote: > > > The mntput() in delayed_fput() is the last function call. So before that > > moment, > > sys_umount() may see mnt_get_count() as 2, so it avoids EBUSY condition. > > I'm

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-15 Thread Jaegeuk Kim
On 09/15, Theodore Ts'o wrote: > On Fri, Sep 15, 2017 at 11:44:33AM -0700, Jaegeuk Kim wrote: > > > > So, I digged it in more detail, and found, in drivers/android/binder.c [1], > > - binder_ioctl() > > - create a kernel thread > > - zombie_cleanup_

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-15 Thread Jaegeuk Kim
On 09/15, Theodore Ts'o wrote: > On Fri, Sep 15, 2017 at 11:44:33AM -0700, Jaegeuk Kim wrote: > > > > So, I digged it in more detail, and found, in drivers/android/binder.c [1], > > - binder_ioctl() > > - create a kernel thread > > - zombie_cleanup_

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-15 Thread Jaegeuk Kim
On 09/15, Al Viro wrote: > On Thu, Sep 14, 2017 at 08:45:18PM -0700, Jaegeuk Kim wrote: > > > > Which filesystem it is? With root I would've expected remount ro done > > > by sys_umount(); with anything else... How has it managed to avoid > > > -EBUSY? If it w

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-15 Thread Jaegeuk Kim
On 09/15, Al Viro wrote: > On Thu, Sep 14, 2017 at 08:45:18PM -0700, Jaegeuk Kim wrote: > > > > Which filesystem it is? With root I would've expected remount ro done > > > by sys_umount(); with anything else... How has it managed to avoid > > > -EBUSY? If it w

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-14 Thread Jaegeuk Kim
On 09/15, Al Viro wrote: > On Thu, Sep 14, 2017 at 05:19:39PM -0700, Jaegeuk Kim wrote: > > Instead, I put more traces in the reboot procedure, and got a clue to > > suspect > > the below flow. > > > > delayed_fput() init > >

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-14 Thread Jaegeuk Kim
On 09/15, Al Viro wrote: > On Thu, Sep 14, 2017 at 05:19:39PM -0700, Jaegeuk Kim wrote: > > Instead, I put more traces in the reboot procedure, and got a clue to > > suspect > > the below flow. > > > > delayed_fput() init > >

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-14 Thread Jaegeuk Kim
On 09/14, Jaegeuk Kim wrote: > On 09/14, Al Viro wrote: > > On Thu, Sep 14, 2017 at 02:30:17AM +0100, Al Viro wrote: > > > On Wed, Sep 13, 2017 at 06:10:48PM -0700, Jaegeuk Kim wrote: > > > > > > > Android triggers umount(2) by init process, wh

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-14 Thread Jaegeuk Kim
On 09/14, Jaegeuk Kim wrote: > On 09/14, Al Viro wrote: > > On Thu, Sep 14, 2017 at 02:30:17AM +0100, Al Viro wrote: > > > On Wed, Sep 13, 2017 at 06:10:48PM -0700, Jaegeuk Kim wrote: > > > > > > > Android triggers umount(2) by init process, wh

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-14 Thread Jaegeuk Kim
On 09/14, Al Viro wrote: > On Thu, Sep 14, 2017 at 02:30:17AM +0100, Al Viro wrote: > > On Wed, Sep 13, 2017 at 06:10:48PM -0700, Jaegeuk Kim wrote: > > > > > Android triggers umount(2) by init process, which is definitely not a > > > kernel > > > thread

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-14 Thread Jaegeuk Kim
On 09/14, Al Viro wrote: > On Thu, Sep 14, 2017 at 02:30:17AM +0100, Al Viro wrote: > > On Wed, Sep 13, 2017 at 06:10:48PM -0700, Jaegeuk Kim wrote: > > > > > Android triggers umount(2) by init process, which is definitely not a > > > kernel > > > thread

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-13 Thread Jaegeuk Kim
On 09/14, Al Viro wrote: > On Wed, Sep 13, 2017 at 04:31:16PM -0700, Jaegeuk Kim wrote: > > Hi Al, > > > > On 09/14, Al Viro wrote: > > > On Wed, Sep 13, 2017 at 01:09:41PM -0700, Jaegeuk Kim wrote: > > > > + if (!retval && (flags &a

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-13 Thread Jaegeuk Kim
On 09/14, Al Viro wrote: > On Wed, Sep 13, 2017 at 04:31:16PM -0700, Jaegeuk Kim wrote: > > Hi Al, > > > > On 09/14, Al Viro wrote: > > > On Wed, Sep 13, 2017 at 01:09:41PM -0700, Jaegeuk Kim wrote: > > > > + if (!retval && (flags &a

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-13 Thread Jaegeuk Kim
Hi Al, On 09/14, Al Viro wrote: > On Wed, Sep 13, 2017 at 01:09:41PM -0700, Jaegeuk Kim wrote: > > + if (!retval && (flags & UMOUNT_WAIT)) { > > + if (likely(!(current->flags & PF_KTHREAD))) > > + task_work_run(); > &g

Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-13 Thread Jaegeuk Kim
Hi Al, On 09/14, Al Viro wrote: > On Wed, Sep 13, 2017 at 01:09:41PM -0700, Jaegeuk Kim wrote: > > + if (!retval && (flags & UMOUNT_WAIT)) { > > + if (likely(!(current->flags & PF_KTHREAD))) > > + task_work_run(); > &g

[PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-13 Thread Jaegeuk Kim
filesystem, but its instance is sitll alive. Cc: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/namespace.c | 12 +++- include/linux/fs.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs

[PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion

2017-09-13 Thread Jaegeuk Kim
filesystem, but its instance is sitll alive. Cc: Al Viro Signed-off-by: Jaegeuk Kim --- fs/namespace.c | 12 +++- include/linux/fs.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index f8893dc6a989..b1ac89915b10 100644 --- a/fs

[GIT PULL] f2fs: update for 4.14-rc1

2017-09-12 Thread Jaegeuk Kim
f2fs: hurry up to issue discard after io interruption Daeho Jeong (1): f2fs: clear radix tree dirty tag of pages whose dirty flag is cleared Ernesto A. Fernández (1): f2fs: preserve i_mode if __f2fs_set_acl() fails Jaegeuk Kim (22): f2fs: give a try to do atomic write in -ENOMEM

[GIT PULL] f2fs: update for 4.14-rc1

2017-09-12 Thread Jaegeuk Kim
f2fs: hurry up to issue discard after io interruption Daeho Jeong (1): f2fs: clear radix tree dirty tag of pages whose dirty flag is cleared Ernesto A. Fernández (1): f2fs: preserve i_mode if __f2fs_set_acl() fails Jaegeuk Kim (22): f2fs: give a try to do atomic write in -ENOMEM

Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands

2017-09-12 Thread Jaegeuk Kim
On 09/12, Daeho Jeong wrote: > > Yeah, that's exactly like what I made a mistake before. > > I should have mentioned that earlier. :) > > Or I think the previous code which used "iter++" might be right. > You might just want to check the fixed number of small discards, > DISCARD_ISSUE_RATE, >

Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands

2017-09-12 Thread Jaegeuk Kim
On 09/12, Daeho Jeong wrote: > > Yeah, that's exactly like what I made a mistake before. > > I should have mentioned that earlier. :) > > Or I think the previous code which used "iter++" might be right. > You might just want to check the fixed number of small discards, > DISCARD_ISSUE_RATE, >

Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands

2017-09-11 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > On 2017/9/12 9:53, Chao Yu wrote: > > On 2017/9/11 11:38, Jaegeuk Kim wrote: > >> If issue_cond is true, it does double count for # of issued commands. > >> > >> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> > &g

Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands

2017-09-11 Thread Jaegeuk Kim
On 09/12, Chao Yu wrote: > On 2017/9/12 9:53, Chao Yu wrote: > > On 2017/9/11 11:38, Jaegeuk Kim wrote: > >> If issue_cond is true, it does double count for # of issued commands. > >> > >> Signed-off-by: Jaegeuk Kim > > > > Reviewed-by: Chao Yu

[PATCH] f2fs: fix double count on issued discard commands

2017-09-10 Thread Jaegeuk Kim
If issue_cond is true, it does double count for # of issued commands. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 7fd742f747ce..25196ff5d587 100644 --

[PATCH] f2fs: fix double count on issued discard commands

2017-09-10 Thread Jaegeuk Kim
If issue_cond is true, it does double count for # of issued commands. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 7fd742f747ce..25196ff5d587 100644 --- a/fs/f2fs/segment.c +++ b

Re: [PATCH] f2fs: speed up gc_urgent mode with SSR and more discard commands

2017-09-09 Thread Jaegeuk Kim
It turns out it doesn't need to change discarding policy below. I submitted another patch to modify SSR mode only. Thanks, On 09/09, Jaegeuk Kim wrote: > From: Jaegeuk Kim <jaeg...@google.com> > > This patch activates SSR and issuing more discard commands in gc_urgent mode.

Re: [PATCH] f2fs: speed up gc_urgent mode with SSR and more discard commands

2017-09-09 Thread Jaegeuk Kim
It turns out it doesn't need to change discarding policy below. I submitted another patch to modify SSR mode only. Thanks, On 09/09, Jaegeuk Kim wrote: > From: Jaegeuk Kim > > This patch activates SSR and issuing more discard commands in gc_urgent mode. > > Signed-off-

[PATCH 2/2] f2fs: better to wait for fstrim completion

2017-09-09 Thread Jaegeuk Kim
In android, we'd better wait for fstrim completion instead of issuing the discard commands asynchronous. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/segment.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c

[PATCH 2/2] f2fs: better to wait for fstrim completion

2017-09-09 Thread Jaegeuk Kim
In android, we'd better wait for fstrim completion instead of issuing the discard commands asynchronous. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index f96e61e8ddf7

[PATCH 1/2] f2fs: speed up gc_urgent mode with SSR

2017-09-09 Thread Jaegeuk Kim
From: Jaegeuk Kim <jaeg...@google.com> This patch activates SSR in gc_urgent mode. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segment.c | 15 +++ fs/f2fs/segment.h | 13 - 3 files changed, 16 insertions(+), 13 deleti

[PATCH 1/2] f2fs: speed up gc_urgent mode with SSR

2017-09-09 Thread Jaegeuk Kim
From: Jaegeuk Kim This patch activates SSR in gc_urgent mode. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segment.c | 15 +++ fs/f2fs/segment.h | 13 - 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h

[PATCH] f2fs: speed up gc_urgent mode with SSR and more discard commands

2017-09-09 Thread Jaegeuk Kim
From: Jaegeuk Kim <jaeg...@google.com> This patch activates SSR and issuing more discard commands in gc_urgent mode. Signed-off-by: Jaegeuk Kim <jaeg...@google.com> --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segment.c | 19 ++- fs/f2fs/segment.h | 13 - 3 f

[PATCH] f2fs: speed up gc_urgent mode with SSR and more discard commands

2017-09-09 Thread Jaegeuk Kim
From: Jaegeuk Kim This patch activates SSR and issuing more discard commands in gc_urgent mode. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segment.c | 19 ++- fs/f2fs/segment.h | 13 - 3 files changed, 19 insertions(+), 14 deletions(-) diff

Re: [PATCH 3/3] f2fs: support flexible inline xattr size

2017-09-06 Thread Jaegeuk Kim
On 09/06, Chao Yu wrote: > Hi Jaegeuk, > > Do we have time to test and stabilize this new feature before merge window? Let's try this in the next merge window. It's too tight to test now. :) > > Thanks, > > On 2017/9/4 18:58, Chao Yu wrote: > > Now, in product, more and more features based on

Re: [PATCH 3/3] f2fs: support flexible inline xattr size

2017-09-06 Thread Jaegeuk Kim
On 09/06, Chao Yu wrote: > Hi Jaegeuk, > > Do we have time to test and stabilize this new feature before merge window? Let's try this in the next merge window. It's too tight to test now. :) > > Thanks, > > On 2017/9/4 18:58, Chao Yu wrote: > > Now, in product, more and more features based on

[PATCH] f2fs: make get_lock_data_page to handle encrypted inode

2017-09-06 Thread Jaegeuk Kim
This patch refactors get_lock_data_page() to handle encryption case directly. In order to do that, it introduces common f2fs_submit_page_read(). Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/data.c | 109 +++-- 1 file chang

[PATCH] f2fs: make get_lock_data_page to handle encrypted inode

2017-09-06 Thread Jaegeuk Kim
This patch refactors get_lock_data_page() to handle encryption case directly. In order to do that, it introduces common f2fs_submit_page_read(). Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 109 +++-- 1 file changed, 51 insertions(+), 58

Re: [PATCH] f2fs: fix wrong bfree and bavail

2017-09-05 Thread Jaegeuk Kim
On 09/06, Chao Yu wrote: > On 2017/9/6 5:06, Jaegeuk Kim wrote: > > This patch fixes bavail and bfree finally. > > > > longf_bfree;/* free blocks in fs */ > > longf_bavail; /* free blocks avail to non-superuser */ > > > > So, bfree represent

Re: [PATCH] f2fs: fix wrong bfree and bavail

2017-09-05 Thread Jaegeuk Kim
On 09/06, Chao Yu wrote: > On 2017/9/6 5:06, Jaegeuk Kim wrote: > > This patch fixes bavail and bfree finally. > > > > longf_bfree;/* free blocks in fs */ > > longf_bavail; /* free blocks avail to non-superuser */ > > > > So, bfree represent

[PATCH 1/2] f2fs: introduce f2fs_encrypted_file for clean-up

2017-09-05 Thread Jaegeuk Kim
This patch replaces (f2fs_encrypted_inode() && S_ISREG()) with f2fs_encrypted_file(), which gives no functional change. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/data.c | 10 +- fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 2 +- fs/f2fs/gc.c

[PATCH 2/2] f2fs: use generic terms used for encrypted block management

2017-09-05 Thread Jaegeuk Kim
This patch renames functions regarding to buffer management via META_MAPPING used for encrypted blocks especially. We can actually use them in generic way. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/data.c| 6 +++--- fs/f2fs/f2fs.h| 3 +-- fs/f2fs/file.c| 2

[PATCH 1/2] f2fs: introduce f2fs_encrypted_file for clean-up

2017-09-05 Thread Jaegeuk Kim
This patch replaces (f2fs_encrypted_inode() && S_ISREG()) with f2fs_encrypted_file(), which gives no functional change. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 10 +- fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 2 +- fs/f2fs/gc.c | 5 ++--- fs/f2fs/inlin

[PATCH 2/2] f2fs: use generic terms used for encrypted block management

2017-09-05 Thread Jaegeuk Kim
This patch renames functions regarding to buffer management via META_MAPPING used for encrypted blocks especially. We can actually use them in generic way. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c| 6 +++--- fs/f2fs/f2fs.h| 3 +-- fs/f2fs/file.c| 2 +- fs/f2fs/gc.c | 13

Re: [PATCH] f2fs: fix wrong bfree and bavail

2017-09-05 Thread Jaegeuk Kim
On 09/05, Andreas Dilger wrote: > On Sep 5, 2017, at 3:06 PM, Jaegeuk Kim <jaeg...@kernel.org> wrote: > > > > This patch fixes bavail and bfree finally. > > > > longf_bfree;/* free blocks in fs */ > > longf_bavail; /* free blocks avail

Re: [PATCH] f2fs: fix wrong bfree and bavail

2017-09-05 Thread Jaegeuk Kim
On 09/05, Andreas Dilger wrote: > On Sep 5, 2017, at 3:06 PM, Jaegeuk Kim wrote: > > > > This patch fixes bavail and bfree finally. > > > > longf_bfree;/* free blocks in fs */ > > longf_bavail; /* free blocks avail to non-superuser */ > > &g

[PATCH] f2fs: fix wrong bfree and bavail

2017-09-05 Thread Jaegeuk Kim
rrect f_bfree calculation in ->statfs") Cc: <sta...@vger.kernel.org> # 4.8+ Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 7e29db227910..17cca4cb

[PATCH] f2fs: fix wrong bfree and bavail

2017-09-05 Thread Jaegeuk Kim
rrect f_bfree calculation in ->statfs") Cc: # 4.8+ Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 7e29db227910..17cca4cb93af 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@

Re: [PATCH] f2fs: avoid needless inode updates

2017-09-01 Thread Jaegeuk Kim
Please ignore this patch. Thanks, On 09/01, Jaegeuk Kim wrote: > If i_size wan't change at all, we don't need to write inode during fsync. > > Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> > --- > fs/f2fs/f2fs.h | 10 +- > 1 file changed, 5 insertions(+),

Re: [PATCH] f2fs: avoid needless inode updates

2017-09-01 Thread Jaegeuk Kim
Please ignore this patch. Thanks, On 09/01, Jaegeuk Kim wrote: > If i_size wan't change at all, we don't need to write inode during fsync. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/f2fs.h | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > dif

[PATCH] f2fs: avoid needless inode updates

2017-09-01 Thread Jaegeuk Kim
If i_size wan't change at all, we don't need to write inode during fsync. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4b993961d81d..0d76b572484a

[PATCH] f2fs: avoid needless inode updates

2017-09-01 Thread Jaegeuk Kim
If i_size wan't change at all, we don't need to write inode during fsync. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4b993961d81d..0d76b572484a 100644 --- a/fs/f2fs/f2fs.h

[PATCH 2/2] f2fs: don't check inode's checksum if it was dirtied or writebacked

2017-09-01 Thread Jaegeuk Kim
If another thread already made the page dirtied or writebacked, we must avoid to verify checksum. If we got an error, we need to remove its uptodate as well. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/inode.c | 3 ++- fs/f2fs/node.c | 2 +- 2 files changed, 3 insertions

[PATCH 2/2] f2fs: don't check inode's checksum if it was dirtied or writebacked

2017-09-01 Thread Jaegeuk Kim
If another thread already made the page dirtied or writebacked, we must avoid to verify checksum. If we got an error, we need to remove its uptodate as well. Signed-off-by: Jaegeuk Kim --- fs/f2fs/inode.c | 3 ++- fs/f2fs/node.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 1/2] f2fs: don't need to update inode checksum for recovery

2017-09-01 Thread Jaegeuk Kim
This patch fixes "f2fs: support inode checksum". The recovered inode page will be rewritten with valid checksum. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/node.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c in

[PATCH 1/2] f2fs: don't need to update inode checksum for recovery

2017-09-01 Thread Jaegeuk Kim
This patch fixes "f2fs: support inode checksum". The recovered inode page will be rewritten with valid checksum. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 2654c9166fba..388a00262a5f 10064

[PATCH] f2fs: wake up discard_thread iff there is a candidate

2017-08-24 Thread Jaegeuk Kim
This patch fixes to avoid needless wake ups. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/segment.c | 3 +-- fs/f2fs/segment.h | 25 + fs/f2fs/sysfs.c | 6 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/segment.

[PATCH] f2fs: wake up discard_thread iff there is a candidate

2017-08-24 Thread Jaegeuk Kim
This patch fixes to avoid needless wake ups. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 3 +-- fs/f2fs/segment.h | 25 + fs/f2fs/sysfs.c | 6 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index

[PATCH] f2fs: issue discard commands if gc_urgent is set

2017-08-21 Thread Jaegeuk Kim
It's time to issue all the discard commands, if user sets the idle time. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/segment.c | 6 +- fs/f2fs/sysfs.c | 5 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c

[PATCH] f2fs: issue discard commands if gc_urgent is set

2017-08-21 Thread Jaegeuk Kim
It's time to issue all the discard commands, if user sets the idle time. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 6 +- fs/f2fs/sysfs.c | 5 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1387925a0d83

Re: [PATCH v4] f2fs: introduce discard_granularity sysfs entry

2017-08-21 Thread Jaegeuk Kim
d granularity as sysfs entry for configuration in different scenario. Jaegeuk Kim: We must issue all the accumulated discard commands when fstrim is called. So, I've added pend_list_tag[] to indicate whether we should issue the commands or not. If tag sets P_ACTIVE or P_TRIM, we have to iss

Re: [PATCH v4] f2fs: introduce discard_granularity sysfs entry

2017-08-21 Thread Jaegeuk Kim
ntry for configuration in different scenario. Jaegeuk Kim: We must issue all the accumulated discard commands when fstrim is called. So, I've added pend_list_tag[] to indicate whether we should issue the commands or not. If tag sets P_ACTIVE or P_TRIM, we have to issue them. P_TRIM is set once a

Re: [PATCH v4] f2fs: introduce discard_granularity sysfs entry

2017-08-15 Thread Jaegeuk Kim
On 08/15, Chao Yu wrote: > On 2017/8/15 11:45, Jaegeuk Kim wrote: > > On 08/07, Chao Yu wrote: > >> From: Chao Yu <yuch...@huawei.com> > >> > >> Commit d618ebaf0aa8 ("f2fs: enable small discard by default") enables > >> f2fs to issu

Re: [PATCH v4] f2fs: introduce discard_granularity sysfs entry

2017-08-15 Thread Jaegeuk Kim
On 08/15, Chao Yu wrote: > On 2017/8/15 11:45, Jaegeuk Kim wrote: > > On 08/07, Chao Yu wrote: > >> From: Chao Yu > >> > >> Commit d618ebaf0aa8 ("f2fs: enable small discard by default") enables > >> f2fs to issue 4K size discard in real-time

Re: [PATCH] f2fs: let fill_super handle roll-forward errors

2017-08-15 Thread Jaegeuk Kim
On 08/15, Chao Yu wrote: > On 2017/8/15 11:22, Jaegeuk Kim wrote: > > On 08/15, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2017/8/11 8:42, Jaegeuk Kim wrote: > >>> If we set CP_ERROR_FLAG in roll-forward error, f2fs is no longer to

<    6   7   8   9   10   11   12   13   14   15   >