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

2021-08-11 Thread Chao Yu
On 2021/8/12 11:18, Fengnan Chang wrote: 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 | 24 +++- 1

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

2021-08-11 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 | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-

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

2021-08-11 Thread Fengnan Chang
mistake, forget this... On 2021/8/12 11:05, Fengnan Chang wrote: 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 | 23

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

2021-08-11 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 | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-)

Re: [f2fs-dev] f2fs do DIO write make file corruption

2021-08-11 Thread Wu Bo
在 2021/8/11 20:57, Chao Yu 写道: On 2021/8/11 11:28, Wu Bo wrote: 在 2021/8/11 11:03, Chao Yu 写道: On 2021/8/11 10:48, Wu Bo wrote: I use the following command to create a file, the file may got corruption:  f2fs_io write 2 0 512 inc_num dio $path And when I use bio or to set the chunk size

Re: [f2fs-dev] [PATCH 2/2] fs: Don't create discard thread when device not support realtime discard

2021-08-11 Thread Chao Yu
On 2021/8/11 21:18, Yangtao Li wrote: From: 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/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/se

Re: [f2fs-dev] [PATCH v2] f2fs: warn on when fsck flag is set

2021-08-11 Thread Chao Yu
On 2021/8/11 21:30, Yangtao Li wrote: 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 problem. Signed-off-by: Yangtao Li --- v2: -convert to WA

[f2fs-dev] [PATCH v3] f2fs: warn on when fsck flag is set

2021-08-11 Thread Yangtao Li
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 problem. Signed-off-by: Yangtao Li --- v3: -Remove extra parentheses v2: -Convert to WARN_ON -One

Re: [f2fs-dev] [PATCH 1/2] f2fs: fix potential memory leaks in create_discard_cmd_control

2021-08-11 Thread Chao Yu
On 2021/8/11 21:18, Yangtao Li wrote: Release f2fs_issue_discard every time it is destroyed, otherwise it will cause memory leaks when remounting. I didn't get the problem here, could you please explain a bit more about details? Thanks, Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 2

[f2fs-dev] [PATCH v2] f2fs: warn on when fsck flag is set

2021-08-11 Thread Yangtao Li
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 problem. Signed-off-by: Yangtao Li --- v2: -convert to WARN_ON -one more blank fs/f2fs/f2fs.h |

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

2021-08-11 Thread Yangtao Li
From: 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/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 363779a4402d..bc4ac46f3041 1

[f2fs-dev] [PATCH 1/2] f2fs: fix potential memory leaks in create_discard_cmd_control

2021-08-11 Thread Yangtao Li
Release f2fs_issue_discard every time it is destroyed, otherwise it will cause memory leaks when remounting. Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index afe20c5c3c08..363779a4402d 100644 --- a/f

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

2021-08-11 Thread Chao Yu
On 2021/8/11 16:40, Fengnan Chang wrote: 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/compress.c | 1 + fs/f2fs/data.c |

Re: [f2fs-dev] f2fs do DIO write make file corruption

2021-08-11 Thread Chao Yu
On 2021/8/11 11:28, Wu Bo wrote: 在 2021/8/11 11:03, Chao Yu 写道: On 2021/8/11 10:48, Wu Bo wrote: I use the following command to create a file, the file may got corruption: f2fs_io write 2 0 512 inc_num dio $path And when I use bio or to set the chunk size to 1 block, the file is normal.

Re: [f2fs-dev] [PATCH] f2fs: warn on when fsck flag is set

2021-08-11 Thread Chao Yu
On 2021/8/11 18:16, Yangtao Li wrote: 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 problem. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h |

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

2021-08-11 Thread Chao Yu
On 2021/8/11 13:41, Daeho Jeong wrote: On Tue, Aug 10, 2021 at 6:58 PM Chao Yu wrote: On 2021/8/10 2:54, Daeho Jeong wrote: From: Daeho Jeong Added a mount option to control block allocation mode for filesystem developer to simulate filesystem fragmentation and after-GC situation for experi

[f2fs-dev] [PATCH] f2fs: warn on when fsck flag is set

2021-08-11 Thread Yangtao Li
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 problem. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 1 + 1 file changed, 1 insertion(+) diff

Re: [f2fs-dev] [PATCH v4 3/6] block: change ioprio_valid() to an inline function

2021-08-11 Thread Johannes Thumshirn
On 11/08/2021 10:51, Damien Le Moal wrote: > On 2021/08/11 16:56, Johannes Thumshirn wrote: >> On 11/08/2021 05:37, Damien Le Moal wrote: >>> Change the ioprio_valid() macro in include/usapi/linux/ioprio.h to an >>> uapi ~^ >> >>> inline function declared on

Re: [f2fs-dev] [PATCH v4 3/6] block: change ioprio_valid() to an inline function

2021-08-11 Thread Damien Le Moal
On 2021/08/11 16:56, Johannes Thumshirn wrote: > On 11/08/2021 05:37, Damien Le Moal wrote: >> Change the ioprio_valid() macro in include/usapi/linux/ioprio.h to an >> uapi ~^ > >> inline function declared on the kernel side in include/linux/ioprio.h. >> Als

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

2021-08-11 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/compress.c | 1 + fs/f2fs/data.c | 21 - fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH v4 3/6] block: change ioprio_valid() to an inline function

2021-08-11 Thread Johannes Thumshirn
On 11/08/2021 05:37, Damien Le Moal wrote: > Change the ioprio_valid() macro in include/usapi/linux/ioprio.h to an >uapi ~^ > inline function declared on the kernel side in include/linux/ioprio.h. > Also improve checks on the class value by checking the upp