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

2022-10-20 Thread zhangqilong via Linux-f2fs-devel
> 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 w/h F2FS_IOC_MOVE_RANGE > > # (ra

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

2022-10-20 Thread Chao Yu
Yangtao, On 2022/10/18 15:46, Yangtao Li wrote: Added a new sysfs node called gc_urgent_mid_remaining. The user can set the trial count limit for GC urgent mid mode with this value. If GC thread gets to the limit, the mode will turn back to GC normal mode. Not sure, we will add gc_urgent_low_r

[f2fs-dev] 答复: [PATCH] f2fs: introduce gc_urgent_mid_remaining sysfs node

2022-10-20 Thread 李扬韬 via Linux-f2fs-devel
Chao, > Not sure, we will add gc_urgent_low_remaining later... > Can we share the same interface for all gc_mode? since each mode is exclusive. > Thoughts? Both GC urgent mid mode and GC urgent high mode run using the urgent_sleep_time interval. If the user program does not switch back to norm

Re: [f2fs-dev] [PATCH] f2fs: fix possible memory leak in f2fs_init_sysfs()

2022-10-20 Thread Chao Yu
On 2022/10/18 15:32, Yang Yingliang wrote: Inject fault while probing module, kset_register() may fail, if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. Fix this by calling kset_put(), so that name can be freed in callback functio

Re: [f2fs-dev] [PATCH] f2fs: fix the assign logic of iocb

2022-10-20 Thread Chao Yu
On 2022/10/20 0:17, Mukesh Ojha wrote: commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint") introduces iocb field in 'f2fs_direct_IO_enter' trace event And it only assigns the pointer and later it accesses its field in trace print log. Fix it by correcting data type and memcpy t

Re: [f2fs-dev] [PATCH 1/3] f2fs-tools: give less overprovisioning space

2022-10-20 Thread Shinichiro Kawasaki via Linux-f2fs-devel
On Oct 10, 2022 / 15:15, Jaegeuk Kim wrote: > As f2fs becomes more resilient for GCs, let's give the marginal overprovision > space back to user. > > Signed-off-by: Jaegeuk Kim Hello Jaegeuk, Using the dev branch of f2fs-tools repo, I observed mkfs.f2fs failure with zoned block devices:

Re: [f2fs-dev] [PATCH] f2fs: fix the assign logic of iocb

2022-10-20 Thread Mukesh Ojha
Hi, On 10/20/2022 2:31 PM, Chao Yu wrote: On 2022/10/20 0:17, Mukesh Ojha wrote: commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint") introduces iocb field in 'f2fs_direct_IO_enter' trace event And it only assigns the pointer and later it accesses its field in trace print log.

Re: [f2fs-dev] [PATCH] f2fs: fix the assign logic of iocb

2022-10-20 Thread Chao Yu
On 2022/10/20 17:27, Mukesh Ojha wrote: Hi, On 10/20/2022 2:31 PM, Chao Yu wrote: On 2022/10/20 0:17, Mukesh Ojha wrote: commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint") introduces iocb field in 'f2fs_direct_IO_enter' trace event And it only assigns the pointer and later i

Re: [f2fs-dev] [PATCH 1/3] f2fs-tools: give less overprovisioning space

2022-10-20 Thread Jaegeuk Kim
On 10/20, Shinichiro Kawasaki wrote: > On Oct 10, 2022 / 15:15, Jaegeuk Kim wrote: > > As f2fs becomes more resilient for GCs, let's give the marginal > > overprovision > > space back to user. > > > > Signed-off-by: Jaegeuk Kim > > Hello Jaegeuk, > > Using the dev branch of f2fs-tools repo, I

[f2fs-dev] [PATCH 10/11] drm/amdgpu/discovery: fix possible memory leak

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
If kset_register() fails, the refcount of kobject is not 0, the name allocated in kobject_set_name(&kset.kobj, ...) is leaked. Fix this by calling kset_put(), so that it will be freed in callback function kobject_cleanup(). Cc: sta...@vger.kernel.org Fixes: a6c40b178092 ("drm/amdgpu: Show IP disco

[f2fs-dev] [PATCH 04/11] kobject: fix possible memory leak in kset_create_and_add()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module (e.g. qemu_fw_cfg.ko), kset_register() may fail in kset_create_and_add(), if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kset_create() is leaked. To fix this by calling kset_put(), so that name can be freed in callback functio

[f2fs-dev] [PATCH 06/11] firmware: qemu_fw_cfg: fix possible memory leak in fw_cfg_build_symlink()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module, kset_register() may fail, if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. To fix this by calling kset_put(), so that name can be freed in callback function kobject_cleanup() and 'subdir' is freed

[f2fs-dev] [PATCH 11/11] ubifs: Fix memory leak in ubifs_sysfs_init()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
From: Liu Shixin When insmod ubifs.ko, a kmemleak reported as below: unreferenced object 0x88817fb1a780 (size 8): comm "insmod", pid 25265, jiffies 4295239702 (age 100.130s) hex dump (first 8 bytes): 75 62 69 66 73 00 ff ff ubifs... backtrace: []

[f2fs-dev] [PATCH 07/11] f2fs: fix possible memory leak in f2fs_init_sysfs()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module, kset_register() may fail, if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. Fix this by calling kset_put(), so that name can be freed in callback function kobject_cleanup(). unreferenced object 0xf

[f2fs-dev] [PATCH 00/11] fix memory leak while kset_register() fails

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
The previous discussion link: https://lore.kernel.org/lkml/0db486eb-6927-927e-3629-958f8f211...@huawei.com/T/ kset_register() is currently used in some places without calling kset_put() in error path, because the callers think it should be kset internal thing to do, but the driver core can not kno

[f2fs-dev] [PATCH 03/11] bus: fix possible memory leak in bus_register()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module (e.g. edac_core.ko), kset_register() may fail in bus_register(), if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. To fix this by calling kset_put(), so that name can be freed in callback function ko

[f2fs-dev] [PATCH 08/11] erofs: fix possible memory leak in erofs_init_sysfs()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module, kset_register() may fail, if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. Fix this by calling kset_put(), so that name can be freed in callback function kobject_cleanup(). unreferenced object 0xf

[f2fs-dev] [PATCH 01/11] kset: fix documentation for kset_register()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
kset_register() is currently used in some places without calling kset_put() in error path, because the callers think it should be kset internal thing to do, but the driver core can not know what caller doing with that memory at times. The memory could be freed both in kset_put() and error path of c

[f2fs-dev] [PATCH 02/11] kset: add null pointer check in kset_put()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
kset_put() can be called from drivers, add null pointer check to make it more robust. Signed-off-by: Yang Yingliang --- include/linux/kobject.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 57fb972fea05..e81de8ba41a2

[f2fs-dev] [PATCH 09/11] ocfs2: possible memory leak in mlog_sys_init()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module, kset_register() may fail, if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. Fix this by calling kset_put(), so that name can be freed in callback function kobject_cleanup(). unreferenced object 0xf

[f2fs-dev] [PATCH 05/11] class: fix possible memory leak in __class_register()

2022-10-20 Thread Yang Yingliang via Linux-f2fs-devel
Inject fault while loading module (e.g. pktcdvd.ko), kset_register() may fail in __class_register(), if it fails, but the refcount of kobject is not decreased to 0, the name allocated in kobject_set_name() is leaked. To fix this by calling kfree_const(). unreferenced object 0x888102fa8190 (siz

[f2fs-dev] [PATCH] f2fs: separate IPU policy for fdatasync from F2FS_IPU_FSYNC

2022-10-20 Thread qixiaoyu1
Currently IPU policy for fdatasync is coupled with F2FS_IPU_FSYNC. Fix to apply it to all IPU policy. Signed-off-by: qixiaoyu1 --- fs/f2fs/data.c | 8 +++- fs/f2fs/file.c | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index a71e818cd6

[f2fs-dev] [PATCH v2] f2fs: fix to invalidate dcc->f2fs_issue_discard in error path

2022-10-20 Thread Chao Yu
Syzbot reports a NULL pointer dereference issue as below: __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] get_task_struct include/linux/sched/task.h:110 [inline] kthread_stop+0x34/0x1c

[f2fs-dev] [Bug 216050] f2fs_gc occupies 100% cpu

2022-10-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216050 --- Comment #64 from Yuriy Garin (yuriy.ga...@gmail.com) --- Running 6.0.1-arch2-1 for a few days. So far, so good! (Previously, this problem occurred from twice a day to once in a two days.) There were quite a lot of changes in f2fs sources in 6

Re: [f2fs-dev] [PATCH 1/3] f2fs-tools: give less overprovisioning space

2022-10-20 Thread Shinichiro Kawasaki via Linux-f2fs-devel
On Oct 20, 2022 / 16:18, Jaegeuk Kim wrote: ... > Thanks, I think that fix looks good to me. I applied into the original patch. > https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?h=dev&id=281d3e72370f6c39c0d57acaf37a7f0e003ddd28 Oh, happy to know that the fix is goo

Re: [f2fs-dev] [PATCH] f2fs: fix the assign logic of iocb

2022-10-20 Thread Pavan Kondeti
Hi Mukesh, On Wed, Oct 19, 2022 at 09:47:57PM +0530, Mukesh Ojha wrote: > commit 18ae8d12991b ("f2fs: show more DIO information in tracepoint") > introduces iocb field in 'f2fs_direct_IO_enter' trace event > And it only assigns the pointer and later it accesses its field > in trace print log. > >

Re: [f2fs-dev] [PATCH 00/11] fix memory leak while kset_register() fails

2022-10-20 Thread Greg KH
On Fri, Oct 21, 2022 at 01:29:31AM -0400, Luben Tuikov wrote: > On 2022-10-20 22:20, Yang Yingliang wrote: > > The previous discussion link: > > https://lore.kernel.org/lkml/0db486eb-6927-927e-3629-958f8f211...@huawei.com/T/ > > The very first discussion on this was here: > > https://www.spinics.

Re: [f2fs-dev] [PATCH 00/11] fix memory leak while kset_register() fails

2022-10-20 Thread Luben Tuikov via Linux-f2fs-devel
On 2022-10-20 22:20, Yang Yingliang wrote: > The previous discussion link: > https://lore.kernel.org/lkml/0db486eb-6927-927e-3629-958f8f211...@huawei.com/T/ The very first discussion on this was here: https://www.spinics.net/lists/dri-devel/msg368077.html Please use this link, and not the that o