Re: [f2fs-dev] [PATCH] f2fs: allow to set compression for inlined file

2022-10-25 Thread Chao Yu
On 2022/10/26 1:46, Jaegeuk Kim wrote: On 10/25, Chao Yu wrote: On 2022/10/25 7:36, Jaegeuk Kim wrote: The below commit disallows to set compression on empty created file which has a inline_data. Let's fix it. Fixes: 7165841d578e ("f2fs: fix to check inline_data during compressed inode

Re: [f2fs-dev] [PATCH] f2fs: allow to set compression for inlined file

2022-10-25 Thread Jaegeuk Kim
On 10/25, Chao Yu wrote: > On 2022/10/25 7:36, Jaegeuk Kim wrote: > > The below commit disallows to set compression on empty created file which > > has a inline_data. Let's fix it. > > > > Fixes: 7165841d578e ("f2fs: fix to check inline_data during compressed > > inode conversion") > >

Re: [f2fs-dev] [PATCH v3] kset: fix memory leak when kset_register() returns error

2022-10-25 Thread Greg KH
On Tue, Oct 25, 2022 at 03:15:49PM +0800, Yang Yingliang wrote: > Inject fault while loading module, kset_register() may fail. > If it fails, the kset.kobj.name allocated by kobject_set_name() > which must be called before a call to kset_register() may be > leaked, since refcount of kobj was set

Re: [f2fs-dev] [PATCH v3] kset: fix memory leak when kset_register() returns error

2022-10-25 Thread Luben Tuikov via Linux-f2fs-devel
On 2022-10-25 03:15, Yang Yingliang wrote: > Inject fault while loading module, kset_register() may fail. > If it fails, the kset.kobj.name allocated by kobject_set_name() > which must be called before a call to kset_register() may be > leaked, since refcount of kobj was set in kset_init().

[f2fs-dev] [PATCH v2] f2fs: add proc entry to show discard_plist info

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
This patch adds a new proc entry to show discard_plist information in more detail, which is very helpful to know the discard pend list count clearly. Such as: Discard pend list(Show diacrd_cmd count on each entry, .:not exist): 0 390 156 85 67 46 37 26

Re: [f2fs-dev] [PATCH v3] f2fs: cleanup in f2fs_create_flush_cmd_control()

2022-10-25 Thread Chao Yu
On 2022/10/25 16:05, Yangtao Li wrote: Just cleanup for readable, no functional changes. Suggested-by: Chao Yu Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH v2] f2fs: fix normal discard process

2022-10-25 Thread Chao Yu
On 2022/10/25 17:40, zhangdongdong wrote: From: Dongdong Zhang In the DPOLICY_BG mode, there is a conflict between the two conditions "i + 1 < dpolicy->granularity" and "i < DEFAULT_DISCARD_GRANULARITY". If i = 15, the first condition is false, it will enter the second condition and dispatch

[f2fs-dev] [PATCH v2] f2fs: fix normal discard process

2022-10-25 Thread zhangdongdong via Linux-f2fs-devel
From: Dongdong Zhang In the DPOLICY_BG mode, there is a conflict between the two conditions "i + 1 < dpolicy->granularity" and "i < DEFAULT_DISCARD_GRANULARITY". If i = 15, the first condition is false, it will enter the second condition and dispatch all small granularity discards in function

[f2fs-dev] [PATCH v3] f2fs: introduce max_ordered_discard sysfs node

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
The current max_ordered_discard is a fixed value, change it to be configurable through the sys node. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++ fs/f2fs/f2fs.h | 3 +++ fs/f2fs/segment.c

[f2fs-dev] [PATCH v3] f2fs: cleanup in f2fs_create_flush_cmd_control()

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
Just cleanup for readable, no functional changes. Suggested-by: Chao Yu Signed-off-by: Yangtao Li --- v3: -avoid UAF fs/f2fs/segment.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index acf3d3fa4363..84a17607dfee 100644 ---

Re: [f2fs-dev] [PATCH v2] f2fs: cleanup in f2fs_create_flush_cmd_control()

2022-10-25 Thread Chao Yu
On 2022/10/25 15:56, Yangtao Li wrote: Remove the local 'err' variable for readable, no functional changes. Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index

[f2fs-dev] [PATCH v2] f2fs: cleanup in f2fs_create_flush_cmd_control()

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
Remove the local 'err' variable for readable, no functional changes. Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index acf3d3fa4363..ed247195a20c 100644 ---

Re: [f2fs-dev] 答复: 答复: 答复: 答复: [PATCH] f2fs: Fix data consistency in f2fs_move_file_range()

2022-10-25 Thread Chao Yu
On 2022/10/25 15:36, zhangqilong wrote: On 2022/10/25 15:01, zhangqilong wrote: On 2022/10/25 14:27, zhangqilong wrote: On 2022/10/20 15:27, zhangqilong via Linux-f2fs-devel wrote: On 2022/10/18 10:45, Zhang Qilong wrote: In the following case: process 1 process 2

Re: [f2fs-dev] [PATCH v2] f2fs: introduce max_ordered_discard sysfs node

2022-10-25 Thread Chao Yu
On 2022/10/25 15:35, Yangtao Li wrote: The current max_ordered_discard is a fixed value, change it to be configurable through the sys node. Signed-off-by: Yangtao Li --- v2: - s/order/ordered Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++ fs/f2fs/f2fs.h | 3

[f2fs-dev] 答复: 答复: 答复: 答复: [PATCH] f2fs: Fix data consistency in f2fs_move_file_range()

2022-10-25 Thread zhangqilong via Linux-f2fs-devel
> On 2022/10/25 15:01, zhangqilong wrote: > >> On 2022/10/25 14:27, zhangqilong wrote: > On 2022/10/20 15:27, zhangqilong via Linux-f2fs-devel wrote: > >> On 2022/10/18 10:45, Zhang Qilong wrote: > >>> In the following case: > >>> process 1 process 2 > >>>

[f2fs-dev] [PATCH v2] f2fs: introduce max_ordered_discard sysfs node

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
The current max_ordered_discard is a fixed value, change it to be configurable through the sys node. Signed-off-by: Yangtao Li --- v2: - s/order/ordered Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++ fs/f2fs/f2fs.h | 3 +++ fs/f2fs/segment.c

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix gc mode when gc_urgent_high_remaining is 1

2022-10-25 Thread Chao Yu
On 2022/10/25 14:50, Yangtao Li wrote: Under the current logic, when gc_urgent_high_remaining is set to 1, the mode will be switched to normal at the beginning, instead of running in gc_urgent mode. Let's switch the gc mode back to normal when the gc ends. Fixes: 265576181b4a ("f2fs: remove

Re: [f2fs-dev] [PATCH] f2fs: remove redundant return in f2fs_create_flush_cmd_control()

2022-10-25 Thread Chao Yu
On 2022/10/25 15:08, Yangtao Li wrote: Hi Chao, In my point of view, it should not return 0. Because calling kthread_run() to create a kernel thread may fails, and err is assigned a value. I commented on last 'return err' rather than the one in error path... Maybe: --- fs/f2fs/segment.c |

Re: [f2fs-dev] 答复: 答复: 答复: [PATCH] f2fs: Fix data consistency in f2fs_move_file_range()

2022-10-25 Thread Chao Yu
On 2022/10/25 15:01, zhangqilong wrote: On 2022/10/25 14:27, zhangqilong wrote: On 2022/10/20 15:27, zhangqilong via Linux-f2fs-devel wrote: On 2022/10/18 10:45, Zhang Qilong wrote: In the following case: process 1 process 2 ->open A ->mmap ->read # the

[f2fs-dev] [PATCH v3] kset: fix memory leak when kset_register() returns error

2022-10-25 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module, kset_register() may fail. If it fails, the kset.kobj.name allocated by kobject_set_name() which must be called before a call to kset_register() may be leaked, since refcount of kobj was set in kset_init(). To mitigate this, we free the name in kset_register()

Re: [f2fs-dev] [PATCH] f2fs: remove redundant return in f2fs_create_flush_cmd_control()

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
Hi Chao, In my point of view, it should not return 0. Because calling kthread_run() to create a kernel thread may fails, and err is assigned a value. Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH] f2fs: introduce max_order_discard sysfs node

2022-10-25 Thread Chao Yu
On 2022/10/21 18:28, Yangtao Li wrote: The current max_order_discard is a fixed value, max_ordered_discard? change it to be configurable through the sys node. Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++ fs/f2fs/f2fs.h | 3

[f2fs-dev] 答复: 答复: 答复: [PATCH] f2fs: Fix data consistency in f2fs_move_file_range()

2022-10-25 Thread zhangqilong via Linux-f2fs-devel
> On 2022/10/25 14:27, zhangqilong wrote: > >> On 2022/10/20 15:27, zhangqilong via Linux-f2fs-devel wrote: > On 2022/10/18 10:45, Zhang Qilong wrote: > > In the following case: > > process 1 process 2 > > ->open A > > ->mmap > > ->read

Re: [f2fs-dev] [PATCH] f2fs: remove redundant return in f2fs_create_flush_cmd_control()

2022-10-25 Thread Chao Yu
On 2022/10/24 21:59, Yangtao Li wrote: Replace if (A) { .. return err; } return err; with if (A) { .. } return err; Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 1 - 1 file changed,

Re: [f2fs-dev] [PATCH] f2fs: allow to set compression for inlined file

2022-10-25 Thread Chao Yu
On 2022/10/25 7:36, Jaegeuk Kim wrote: The below commit disallows to set compression on empty created file which has a inline_data. Let's fix it. Fixes: 7165841d578e ("f2fs: fix to check inline_data during compressed inode conversion") Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 3 +++

[f2fs-dev] [PATCH] f2fs: fix normal discard process

2022-10-25 Thread zhangdongdong via Linux-f2fs-devel
in the DPOLICY_BG mode, i + 1 < dpolicy->granularity and i < DEFAULT_DISCARD_GRANULARITY conflict. if i = 15,The first condition is not met, it will directly enter the second condition and dispatch all small granularity discards. The restrictive effect of the first condition will be invalidated.

[f2fs-dev] [PATCH v2 2/2] f2fs: introducr gc_urgent_idle_remaining sysfs node and mark gc_urgent_high_remaining node deprecated

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
Added a new sysfs node called gc_urgent_idle_remaining. The user can set the trial count limit for GC urgent and idle mode with this value. If GC thread gets to the limit, the mode will turn back to GC normal mode finally. This method is not only applicable to gc_urgent_high, but applicable to

[f2fs-dev] [PATCH v2 1/2] f2fs: fix gc mode when gc_urgent_high_remaining is 1

2022-10-25 Thread Yangtao Li via Linux-f2fs-devel
Under the current logic, when gc_urgent_high_remaining is set to 1, the mode will be switched to normal at the beginning, instead of running in gc_urgent mode. Let's switch the gc mode back to normal when the gc ends. Fixes: 265576181b4a ("f2fs: remove gc_urgent_high_limited for cleanup")

Re: [f2fs-dev] 答复: 答复: [PATCH] f2fs: Fix data consistency in f2fs_move_file_range()

2022-10-25 Thread Chao Yu
On 2022/10/25 14:27, zhangqilong wrote: On 2022/10/20 15:27, zhangqilong via Linux-f2fs-devel wrote: On 2022/10/18 10:45, Zhang Qilong wrote: In the following case: process 1 process 2 ->open A ->mmap ->read # the first time

[f2fs-dev] 答复: 答复: [PATCH] f2fs: Fix data consistency in f2fs_move_file_range()

2022-10-25 Thread zhangqilong via Linux-f2fs-devel
> On 2022/10/20 15:27, zhangqilong via Linux-f2fs-devel wrote: > >> On 2022/10/18 10:45, Zhang Qilong wrote: > >>> In the following case: > >>> process 1 process 2 > >>>->open A > >>> ->mmap > >>> ->read # the first time > >>>->ioctl

Re: [f2fs-dev] [PATCH v2] f2fs: remove batched_trim_sections node

2022-10-25 Thread Chao Yu
On 2022/10/25 11:08, Yangtao Li wrote: commit 377224c47118("f2fs: don't split checkpoint in fstrim") obsolete batch mode and related sysfs entry. Since this testing sysfs node has been deprecated for a long time, let's remove it. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks,