Unverified Commit 723be560 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12464 f2fs: fix to don't set SB_RDONLY in f2fs_handle_critical_error()

parents e828b9db 7e4e6edc
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -4131,12 +4131,14 @@ void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason,
	}

	f2fs_warn(sbi, "Remounting filesystem read-only");

	/*
	 * Make sure updated value of ->s_mount_flags will be visible before
	 * ->s_flags update
	 * We have already set CP_ERROR_FLAG flag to stop all updates
	 * to filesystem, so it doesn't need to set SB_RDONLY flag here
	 * because the flag should be set covered w/ sb->s_umount semaphore
	 * via remount procedure, otherwise, it will confuse code like
	 * freeze_super() which will lead to deadlocks and other problems.
	 */
	smp_wmb();
	sb->s_flags |= SB_RDONLY;
}

static void f2fs_record_error_work(struct work_struct *work)