[PATCH] drivers core: don't do anything in device_del() when device_add() fail

2021-04-01 Thread Yufen Yu
(). That can cause various NULL pointer dereference, including dev->p is NULL in kill_device(), 'name' is NULL in sysfs_remove_link(), kobj->sd is 'NULL' when call dpm_sysfs_remove(), and so on. To avoid these kernel panic, we call device_del() only when device_add() is success. Signed-off-by:

[PATCH] block: remove unused members for io_context

2020-10-20 Thread Yufen Yu
After removing blk-sq code, there is no user of nr_batch_requests and last_waited in kernel. Signed-off-by: Yufen Yu --- include/linux/iocontext.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 1dcd9198beb7..0a9dc40b7be8

[PATCH] kernfs: use common interface kernfs_lockdep() to check lockdep

2020-07-23 Thread Yufen Yu
We can use the common interface to check lockdep instead of reading the flags directly. This patch will not change any existing functionality. Signed-off-by: Yufen Yu --- fs/kernfs/dir.c| 9 - fs/kernfs/file.c | 2 +- fs/sysfs/file.c| 2 +- include/linux/kernfs.h

[PATCH v2] jffs2: safely remove obsolete dirent from the f->dents list

2019-01-22 Thread Yufen Yu
ink() can remove the dirent directly if nobody open the directory(i.e. nr_dir_opending == 0). Otherwise, it just increase obsolete_count, denoting obsolete dirent count of the list. Fixes: 15953580e79b ("[JFFS2] Improve getdents vs. f_pos handling on NOR flash.") Signed-off-by: Yufen Yu

[PATCH] jffs2: safely remove obsolete dirent from the f->dents list

2018-03-29 Thread Yufen Yu
ink() can remove the dirent directly if nobody open the directory(i.e. nr_dir_opending == 0). Otherwise, it just increase obsolete_count, denoting obsolete dirent count of the list. Fixes: 15953580e79b ("[JFFS2] Improve getdents vs. f_pos handling on NOR flash.") Signed-off-by: Yufen Yu

[PATCH] jffs2: safely remove obsolete dirent from the f->dents list

2018-03-29 Thread Yufen Yu
ink() can remove the dirent directly if nobody open the directory(i.e. nr_dir_opending == 0). Otherwise, it just increase obsolete_count, denoting obsolete dirent count of the list. Fixes: 15953580e79b ("[JFFS2] Improve getdents vs. f_pos handling on NOR flash.") Signed-off-by: Yufen Yu

[PATCH] jffs2: remove fd from the f->dents list immediately.

2018-03-16 Thread Yufen Yu
always in the f->dents list. 2. Since the list become longer and longer, more CPU time is used to traverse it. After reverting the commit, we test 'rm -r', which can remove all files, and all seems OK! Signed-off-by: Yufen Yu <yuyu...@huawei.com> ---

[PATCH] jffs2: remove fd from the f->dents list immediately.

2018-03-16 Thread Yufen Yu
always in the f->dents list. 2. Since the list become longer and longer, more CPU time is used to traverse it. After reverting the commit, we test 'rm -r', which can remove all files, and all seems OK! Signed-off-by: Yufen Yu --- fs/jffs2/write.c | 33 +

[RFC PATCH] ubifs: Add zstd support

2018-01-12 Thread Yufen Yu
source repository: https://github.com/facebook/zstd Signed-off-by: Yufen Yu <yuyu...@huawei.com> --- fs/ubifs/Kconfig | 10 ++ fs/ubifs/compress.c| 25 + fs/ubifs/ubifs-media.h | 2 ++ 3 files changed, 37 insertions(+) diff --git a/fs/ubifs/Kconfig b/fs

[RFC PATCH] ubifs: Add zstd support

2018-01-12 Thread Yufen Yu
source repository: https://github.com/facebook/zstd Signed-off-by: Yufen Yu --- fs/ubifs/Kconfig | 10 ++ fs/ubifs/compress.c| 25 + fs/ubifs/ubifs-media.h | 2 ++ 3 files changed, 37 insertions(+) diff --git a/fs/ubifs/Kconfig b/fs/ubifs/Kconfig index

[PATCH v2] f2fs: implement cgroup writeback support

2018-01-09 Thread Yufen Yu
ed-off-by: Yufen Yu <yuyu...@huawei.com> --- fs/f2fs/data.c | 12 ++-- fs/f2fs/f2fs.h | 1 + fs/f2fs/node.c | 1 + fs/f2fs/super.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 516fa0d..1b5b73a 100644 --- a/fs/f2fs/dat

[PATCH v2] f2fs: implement cgroup writeback support

2018-01-09 Thread Yufen Yu
, f2fs_fill_super() is updated to set SB_I_CGROUPWB. Meta writeback IOs is left alone by this patch and will always be attributed to the root cgroup. The results show that f2fs can throttle writeback nicely for data writing and file creating. Reviewed-by: Chao Yu Signed-off-by: Yufen Yu --- fs

[PATCH] f2fs: implement cgroup writeback supprot

2018-01-04 Thread Yufen Yu
, f2fs_fill_super() is updated to set SB_I_CGROUPWB. Meta writeback IOs is left alone by this patch and will always be attributed to the root cgroup. The results show that f2fs can throttle writeback nicely for data writing and file creating. Signed-off-by: Yufen Yu <yuyu...@huawei.com> -

[PATCH] f2fs: implement cgroup writeback supprot

2018-01-04 Thread Yufen Yu
, f2fs_fill_super() is updated to set SB_I_CGROUPWB. Meta writeback IOs is left alone by this patch and will always be attributed to the root cgroup. The results show that f2fs can throttle writeback nicely for data writing and file creating. Signed-off-by: Yufen Yu --- fs/f2fs/data.c | 11