mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status()
@ 2019-07-26  3:45 Jia-Ju Bai
  2019-07-26  3:55 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2019-07-26  3:45 UTC (permalink / raw)
  To: jaegeuk, yuchao0; +Cc: linux-f2fs-devel, linux-kernel, 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 for advice.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 fs/f2fs/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 7706049d23bf..9b0bedd82581 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -67,7 +67,7 @@ static void update_general_status(struct f2fs_sb_info *sbi)
 	si->nr_rd_data = get_pages(sbi, F2FS_RD_DATA);
 	si->nr_rd_node = get_pages(sbi, F2FS_RD_NODE);
 	si->nr_rd_meta = get_pages(sbi, F2FS_RD_META);
-	if (SM_I(sbi) && SM_I(sbi)->fcc_info) {
+	if (SM_I(sbi)->fcc_info) {
 		si->nr_flushed =
 			atomic_read(&SM_I(sbi)->fcc_info->issued_flush);
 		si->nr_flushing =
@@ -75,7 +75,7 @@ static void update_general_status(struct f2fs_sb_info *sbi)
 		si->flush_list_empty =
 			llist_empty(&SM_I(sbi)->fcc_info->issue_list);
 	}
-	if (SM_I(sbi) && SM_I(sbi)->dcc_info) {
+	if (SM_I(sbi)->dcc_info) {
 		si->nr_discarded =
 			atomic_read(&SM_I(sbi)->dcc_info->issued_discard);
 		si->nr_discarding =
-- 
2.17.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status()
  2019-07-26  3:45 [PATCH] fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status() Jia-Ju Bai
@ 2019-07-26  3:55 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2019-07-26  3:55 UTC (permalink / raw)
  To: Jia-Ju Bai, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel

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 checked in
> update_general_status().
> Thank Chao Yu for advice.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-26  3:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26  3:45 [PATCH] fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status() Jia-Ju Bai
2019-07-26  3:55 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®