Re: [f2fs-dev] [PATCH] f2fs: remove broken support for allocating DIO writes

2021-08-16 Thread Christoph Hellwig
On Mon, Aug 16, 2021 at 07:03:21PM -0700, Eric Biggers wrote: > Freeing preallocated blocks on error would be better than nothing, although > note > that the preallocated blocks may have filled an arbitrary sequence of holes -- > so simply truncating past EOF would *not* be sufficient. > > But re

Re: [f2fs-dev] [bug report] f2fs: introduce periodic iostat io latency traces

2021-08-16 Thread Daeho Jeong
Hi Dan, We don't use NR_PAGE_TYPE for the index. Thank you, On Mon, Aug 16, 2021 at 12:37 AM Dan Carpenter wrote: > > Hello Daeho Jeong, > > The patch f4b05791dda9: "f2fs: introduce periodic iostat io latency > traces" from Aug 3, 2021, leads to the following > Smatch static checker warnings: >

Re: [f2fs-dev] [PATCH] f2fs: remove broken support for allocating DIO writes

2021-08-16 Thread Eric Biggers
On Mon, Aug 02, 2021 at 06:34:48PM -0700, Jaegeuk Kim wrote: > On 08/03, Chao Yu wrote: > > On 2021/8/3 2:23, Jaegeuk Kim wrote: > > > On 08/02, Chao Yu wrote: > > > > On 2021/8/2 12:39, Eric Biggers wrote: > > > > > On Fri, Jul 30, 2021 at 10:46:16PM -0400, Theodore Ts'o wrote: > > > > > > On Fri,

Re: [f2fs-dev] [PATCH] f2fs: Add missing inline to f2fs_sanity_check_cluster() stub

2021-08-16 Thread Nathan Chancellor
On 8/16/2021 5:33 PM, Jaegeuk Kim wrote: Hi Nathan, On 08/16, Nathan Chancellor wrote: Without this, there is a warning in nearly every fs/f2fs/ file when F2FS_FS_COMPRESSION is not set: In file included from fs/f2fs/super.c:31: fs/f2fs/f2fs.h:4251:13: warning: unused function 'f2fs_sanity_che

Re: [f2fs-dev] [PATCH] f2fs: Add missing inline to f2fs_sanity_check_cluster() stub

2021-08-16 Thread Jaegeuk Kim
Hi Nathan, On 08/16, Nathan Chancellor wrote: > Without this, there is a warning in nearly every fs/f2fs/ file when > F2FS_FS_COMPRESSION is not set: > > In file included from fs/f2fs/super.c:31: > fs/f2fs/f2fs.h:4251:13: warning: unused function 'f2fs_sanity_check_cluster' > [-Wunused-function]

Re: [f2fs-dev] [PATCH] f2fs: always call f2fs_issue_checkpoint() in f2fs_sync_fs()

2021-08-16 Thread Jaegeuk Kim
On 08/16, Yangtao Li wrote: > Sync is always 1, so delete the check of the value. I don't think so. > > Signed-off-by: Yangtao Li > --- > fs/f2fs/super.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 98727e04d271..b823c

Re: [f2fs-dev] [PATCH] f2fs: Use f2fs_bug_on instead of if condition followed by f2fs_bug_on

2021-08-16 Thread Jaegeuk Kim
No, I don't think this is a right way. On 08/16, Yangtao Li wrote: > Similar: > WARNING: Use BUG_ON instead of if condition followed by BUG. > > Let's replace if (cond) f2fs_bug_on() with f2fs_bug_on(). > > Signed-off-by: Yangtao Li > --- > fs/f2fs/checkpoint.c | 6 ++ > fs/f2fs/compr

Re: [f2fs-dev] [PATCH] f2fs: change value of recovery to bool

2021-08-16 Thread Jaegeuk Kim
Hmm, I don't see a great benefit of this patch. Do we have a chance to use integer to get more specifics of the recovery reason in future? On 08/16, Yangtao Li wrote: > Recovery has only two values, 0 and 1, let's change it to bool type. > > Signed-off-by: Yangtao Li > --- > fs/f2fs/super.c | 1

Re: [f2fs-dev] [PATCH v6] f2fs: introduce /sys/fs/f2fs//fsck_stack node

2021-08-16 Thread Jaegeuk Kim
On 08/16, Chao Yu wrote: > On 2021/8/16 12:02, 李扬韬 wrote: > > HI Chao, > > > > SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, > > > > this flag is set in too many places. For some scenes that are not very > > > > reproducible, adding stack information will help locate the probl

Re: [f2fs-dev] [PATCH 1/2] f2fs: add sysfs nodes to get discard information

2021-08-16 Thread Jaegeuk Kim
On 08/16, 李扬韬 wrote: > I've added new sysfs nodes to show discard stat since mount, which > will help us analyze whether the performance problem is related to > discard. > > issued_discard - Shows the number of issued discard > queued_discard - Shows the number of ca

[f2fs-dev] [PATCH] f2fs: Add missing inline to f2fs_sanity_check_cluster() stub

2021-08-16 Thread Nathan Chancellor
Without this, there is a warning in nearly every fs/f2fs/ file when F2FS_FS_COMPRESSION is not set: In file included from fs/f2fs/super.c:31: fs/f2fs/f2fs.h:4251:13: warning: unused function 'f2fs_sanity_check_cluster' [-Wunused-function] static bool f2fs_sanity_check_cluster(struct dnode_of_data

[f2fs-dev] [PATCH] f2fs: always call f2fs_issue_checkpoint() in f2fs_sync_fs()

2021-08-16 Thread Yangtao Li
Sync is always 1, so delete the check of the value. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 98727e04d271..b823c7e3f303 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -155

[f2fs-dev] [PATCH] f2fs: change value of recovery to bool

2021-08-16 Thread Yangtao Li
Recovery has only two values, 0 and 1, let's change it to bool type. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8fecd3050ccd..98727e04d271 100644 --- a/fs/f2fs/super.c +++ b

[f2fs-dev] [PATCH] f2fs: Use f2fs_bug_on instead of if condition followed by f2fs_bug_on

2021-08-16 Thread Yangtao Li
Similar: WARNING: Use BUG_ON instead of if condition followed by BUG. Let's replace if (cond) f2fs_bug_on() with f2fs_bug_on(). Signed-off-by: Yangtao Li --- fs/f2fs/checkpoint.c | 6 ++ fs/f2fs/compress.c | 3 +-- fs/f2fs/data.c | 6 ++ fs/f2fs/node.h | 4 +--- fs

Re: [f2fs-dev] [PATCH v2] f2fs: introduce blk_alloc_mode mount option

2021-08-16 Thread Chao Yu
On 2021/8/16 15:11, Daeho Jeong wrote: I agree with you. But still I think "fragment" mode should work even in low free space conditions. Otherwise, it will be seeking the free blocks again and again like a busy loop. Or we can change the block allocation way into adaptive mode under low free spa

[f2fs-dev] [bug report] f2fs: introduce periodic iostat io latency traces

2021-08-16 Thread Dan Carpenter
Hello Daeho Jeong, The patch f4b05791dda9: "f2fs: introduce periodic iostat io latency traces" from Aug 3, 2021, leads to the following Smatch static checker warnings: fs/f2fs/f2fs.h:3365 __update_iostat_latency() error: buffer overflow 'sbi->rd_sum_lat' 3 <= 3 fs/f2fs/f2fs.h:3366 __update_iosta

[f2fs-dev] [PATCH v4] f2fs: Don't create discard thread when device not support realtime discard

2021-08-16 Thread Fengnan Chang
Don't create discard thread when device not support realtime discard. Signed-off-by: Fengnan Chang Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segment.c | 25 +++-- fs/f2fs/super.c | 27 ++- 3 files changed, 46 insertions(+), 7 d

Re: [f2fs-dev] [PATCH v2] f2fs: introduce blk_alloc_mode mount option

2021-08-16 Thread Daeho Jeong
I agree with you. But still I think "fragment" mode should work even in low free space conditions. Otherwise, it will be seeking the free blocks again and again like a busy loop. Or we can change the block allocation way into adaptive mode under low free space even staying in "fragment" mode. If w