Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Daeho Jeong
On Wed, Jul 21, 2021 at 6:56 PM Eric Biggers wrote: > > On Wed, Jul 21, 2021 at 06:40:00PM -0700, Daeho Jeong wrote: > > On Wed, Jul 21, 2021 at 6:15 PM Eric Biggers wrote: > > > > > > On Wed, Jul 21, 2021 at 06:04:22PM -0700, Daeho Jeong wrote: > > > > > > > > > > How f2fs stores the mapping

[f2fs-dev] [RFC PATCH] f2fs: compress: reduce one page array alloc and free when write compressed page

2021-07-21 Thread Fengnan Chang
Don't alloc new page array to replace old, just use old page array, try to reduce one page array alloc and free when write compress page. Signed-off-by: Fengnan Chang --- fs/f2fs/compress.c | 14 ++ fs/f2fs/f2fs.h | 1 + 2 files changed, 3 insertions(+), 12 deletions(-) diff

[f2fs-dev] [PATCH -next] f2fs: fix use after free in f2fs_fill_super

2021-07-21 Thread Jack Qiu
The root cause is shrink_dcache_sb after sbi has been freed. So call shrink_dcache_sb before free sbi and other resources. == BUG: KASAN: use-after-free in f2fs_evict_inode+0x31c/0xde5 Read of size 4 at addr 8881d97f0d50 by task

[f2fs-dev] [RFC PATCH] f2fs: compress: avoid duplicate counting of valid blocks when read compressed file

2021-07-21 Thread Fengnan Chang
Since cluster is basic unit of compression, one cluster is compressed or not, so we can calculate valid blocks only for first page in cluster, the other pages just skip. Signed-off-by: Fengnan Chang --- fs/f2fs/data.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff

Re: [f2fs-dev] [PATCH] f2fs: use rwlock instead of rwsem for journal

2021-07-21 Thread Hillf Danton
On Wed, 21 Jul 2021 18:41:49 -0700 Jaegeuk Kim wrote: > >This tries to fix priority inversion in the below condition resulting in >long checkpoint delay. If you are right and the patch makes real sense, feel free to specify a bit more on the priority inversion you are trying to fix, and how the

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Eric Biggers
On Wed, Jul 21, 2021 at 06:40:00PM -0700, Daeho Jeong wrote: > On Wed, Jul 21, 2021 at 6:15 PM Eric Biggers wrote: > > > > On Wed, Jul 21, 2021 at 06:04:22PM -0700, Daeho Jeong wrote: > > > > > > > > How f2fs stores the mapping information doesn't matter. That's an > > > > implementation detail

Re: [f2fs-dev] [PATCH v2] f2fs: fix wrong inflight page stats for directIO

2021-07-21 Thread Eric Biggers
On Wed, Jul 21, 2021 at 05:46:26PM -0700, Eric Biggers wrote: > On Mon, Jul 19, 2021 at 04:45:48PM +0800, Chao Yu wrote: > > Previously, we use sbi->nr_pages[] to account direct IO, the count should > > be based on page granularity rather than bio granularity, fix it. > > > > Fixes: 02b16d0a34a1

[f2fs-dev] [PATCH] f2fs: use rwlock instead of rwsem for journal

2021-07-21 Thread Jaegeuk Kim
This tries to fix priority inversion in the below condition resulting in long checkpoint delay. f2fs_get_node_info() - nat_tree_lock -> sleep in journal_rwsem checkpoint - waiting for nat_tree_lock Signed-off-by:

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Daeho Jeong
On Wed, Jul 21, 2021 at 6:15 PM Eric Biggers wrote: > > On Wed, Jul 21, 2021 at 06:04:22PM -0700, Daeho Jeong wrote: > > > > > > How f2fs stores the mapping information doesn't matter. That's an > > > implementation detail that shouldn't be exposed to userspace. The only > > > thing > > > that

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Eric Biggers
On Wed, Jul 21, 2021 at 06:04:22PM -0700, Daeho Jeong wrote: > > > > How f2fs stores the mapping information doesn't matter. That's an > > implementation detail that shouldn't be exposed to userspace. The only > > thing > > that should be exposed is the actual mapping, and for that it seems

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Daeho Jeong
On Wed, Jul 21, 2021 at 5:15 PM Eric Biggers wrote: > > On Wed, Jul 21, 2021 at 03:30:46PM -0700, Daeho Jeong wrote: > > Hi Eric, > > > > On Wed, Jul 21, 2021 at 2:35 PM Eric Biggers wrote: > > > > > > On Wed, Jul 21, 2021 at 12:20:48AM -0700, Daeho Jeong wrote: > > > > From: Daeho Jeong > > >

Re: [f2fs-dev] [PATCH v2] f2fs: fix wrong inflight page stats for directIO

2021-07-21 Thread Eric Biggers
On Mon, Jul 19, 2021 at 04:45:48PM +0800, Chao Yu wrote: > Previously, we use sbi->nr_pages[] to account direct IO, the count should > be based on page granularity rather than bio granularity, fix it. > > Fixes: 02b16d0a34a1 ("f2fs: add to account direct IO") > Signed-off-by: Chao Yu > --- > v2:

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Eric Biggers
On Wed, Jul 21, 2021 at 03:30:46PM -0700, Daeho Jeong wrote: > Hi Eric, > > On Wed, Jul 21, 2021 at 2:35 PM Eric Biggers wrote: > > > > On Wed, Jul 21, 2021 at 12:20:48AM -0700, Daeho Jeong wrote: > > > From: Daeho Jeong > > > > > > When we print out a discontinuous compression chunk, it shows

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Daeho Jeong
Hi Eric, On Wed, Jul 21, 2021 at 2:35 PM Eric Biggers wrote: > > On Wed, Jul 21, 2021 at 12:20:48AM -0700, Daeho Jeong wrote: > > From: Daeho Jeong > > > > When we print out a discontinuous compression chunk, it shows like a > > continuous chunk now. To show it more correctly, I've changed the

Re: [f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Eric Biggers
On Wed, Jul 21, 2021 at 12:20:48AM -0700, Daeho Jeong wrote: > From: Daeho Jeong > > When we print out a discontinuous compression chunk, it shows like a > continuous chunk now. To show it more correctly, I've changed the way of > printing fiemap info like below. Plus, eliminated NEW_ADDR(-1) in

[f2fs-dev] [PATCH] f2fs-tools: make fiemap command in accordance with uapi

2021-07-21 Thread Daeho Jeong
From: Daeho Jeong Made "fiemap" command in accordance with user api manual. So, eliminated NEW_ADDR print out and made it ends in the last extent. Signed-off-by: Daeho Jeong --- tools/f2fs_io/f2fs_io.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

Re: [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero

2021-07-21 Thread Fengnan Chang
Hi jaegeuk,chao: How about this version ? On 2021/7/2 11:11, Fengnan Chang wrote: We should allow write compress released file after truncate to zero. Signed-off-by: Fengnan Chang --- fs/f2fs/file.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/file.c

[f2fs-dev] [PATCH] f2fs: change fiemap way in printing compression chunk

2021-07-21 Thread Daeho Jeong
From: Daeho Jeong When we print out a discontinuous compression chunk, it shows like a continuous chunk now. To show it more correctly, I've changed the way of printing fiemap info like below. Plus, eliminated NEW_ADDR(-1) in fiemap info, since it is not in fiemap user api manual. 0: