Re: [PATCH] fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status()

2019-07-25 Thread Chao Yu
On 2019/7/26 11:45, Jia-Ju Bai wrote: > In fill_super() and put_super(), f2fs_destroy_stats() is called > in prior to f2fs_destroy_segment_manager(), so if current > sbi can still be visited in global stat list, SM_I(sbi) should be > released yet. > For this reason, SM_I(sbi) does not need to be c

[PATCH] fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status()

2019-07-25 Thread Jia-Ju Bai
In fill_super() and put_super(), f2fs_destroy_stats() is called in prior to f2fs_destroy_segment_manager(), so if current sbi can still be visited in global stat list, SM_I(sbi) should be released yet. For this reason, SM_I(sbi) does not need to be checked in update_general_status(). Thank Chao Yu

Re: [BUG] fs: f2fs: Possible null-pointer dereferences in update_general_status()

2019-07-25 Thread Jia-Ju Bai
On 2019/7/26 11:19, Chao Yu wrote: Hi Jiaju, Thanks for the report, I checked the code, and found it doesn't need to check SM_I(sbi) pointer, this is because in fill_super() and put_super(), we will call f2fs_destroy_stats() in prior to f2fs_destroy_segment_manager(), so if current sbi can st

Re: [f2fs-dev] [BUG] fs: f2fs: Possible null-pointer dereferences in update_general_status()

2019-07-25 Thread Chao Yu
Hi Jiaju, Thanks for the report, I checked the code, and found it doesn't need to check SM_I(sbi) pointer, this is because in fill_super() and put_super(), we will call f2fs_destroy_stats() in prior to f2fs_destroy_segment_manager(), so if current sbi can still be visited in global stat list, SM_I

Re: [f2fs-dev] [Fwd: [mm] [confidence: ] e49f335ded: BUG:sleeping_function_called_from_invalid_context_at_mm/util.c]

2019-07-25 Thread Chao Yu
Hi Jeff, I checked the code, found one suspicious place as below: - f2fs_build_node_manager - init_node_manager - __get_nat_bitmaps - disable_nat_bits(, true) disable_nat_bits(.., lock) { ... if (lock) spin_lock_irqsave(&sbi->cp_lock, flags); __clear_ckpt_fl

[PATCH] f2fs: disallow direct IO in atomic write

2019-07-25 Thread Chao Yu
From: Chao Yu Atomic write needs page cache to cache data of transaction, direct IO should never be allowed in atomic write, detect and deny it when open atomic write file. Signed-off-by: Gao Xiang Signed-off-by: Chao Yu --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[BUG] fs: f2fs: Possible null-pointer dereferences in update_general_status()

2019-07-25 Thread Jia-Ju Bai
In update_general_status(), there are two if statements to check whether SM_I(sbi) is NULL: LINE 70: if (SM_I(sbi) && SM_I(sbi)->fcc_info) LINE 78: if (SM_I(sbi) && SM_I(sbi)->dcc_info) When SM_I(sbi) is NULL, it is used at some places, such as: LINE 88: reserved_segments(sbi)    

[PATCH] f2fs: fix to handle quota_{on,off} correctly

2019-07-25 Thread Chao Yu
With quota_ino feature on, generic/232 reports an inconsistence issue on the image. The root cause is that the testcase tries to: - use quotactl to shutdown journalled quota based on sysfile; - and then use quotactl to enable/turn on quota based on specific file (aquota.user or aquota.group). Eve