Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c029932 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: avoid unable to restart gc thread in remount



In f2fs_remount, we will stop gc thread and set need_restart_gc as true when new
option is set without BG_GC, then if any error occurred in the following
procedure, we can restore to start the gc thread.
But after that, We will fail to restore gc thread in start_gc_thread as BG_GC is
not set in new option, so we'd better move this condition judgment out of
start_gc_thread to fix this issue.

Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 8cdcb713
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -96,8 +96,6 @@ int start_gc_thread(struct f2fs_sb_info *sbi)
	dev_t dev = sbi->sb->s_bdev->bd_dev;
	int err = 0;

	if (!test_opt(sbi, BG_GC))
		goto out;
	gc_th = kmalloc(sizeof(struct f2fs_gc_kthread), GFP_KERNEL);
	if (!gc_th) {
		err = -ENOMEM;
+1 −1
Original line number Diff line number Diff line
@@ -1138,7 +1138,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
	 * If filesystem is not mounted as read-only then
	 * do start the gc_thread.
	 */
	if (!f2fs_readonly(sb)) {
	if (test_opt(sbi, BG_GC) && !f2fs_readonly(sb)) {
		/* After POR, we can run background GC thread.*/
		err = start_gc_thread(sbi);
		if (err)