f2fs: fix to destroy sbi->post_read_wq in error path of f2fs_fill_super()
authorChao Yu <chao@kernel.org>
Fri, 28 Oct 2022 09:30:26 +0000 (17:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:22 +0000 (13:14 +0100)
[ Upstream commit 7b02b2201893a71b881026cf574902019ab00db5 ]

In error path of f2fs_fill_super(), this patch fixes to call
f2fs_destroy_post_read_wq() once if we fail in f2fs_start_ckpt_thread().

Fixes: 261eeb9c1585 ("f2fs: introduce checkpoint_merge mount option")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/super.c

index a0d1ef73b83eaa9c3cce7e5c43ab80c227fa743c..f4e8de1f47899b18e19a13747fcfed52f7345bec 100644 (file)
@@ -4428,9 +4428,9 @@ free_nm:
        f2fs_destroy_node_manager(sbi);
 free_sm:
        f2fs_destroy_segment_manager(sbi);
-       f2fs_destroy_post_read_wq(sbi);
 stop_ckpt_thread:
        f2fs_stop_ckpt_thread(sbi);
+       f2fs_destroy_post_read_wq(sbi);
 free_devices:
        destroy_device_list(sbi);
        kvfree(sbi->ckpt);