Commit 7e09b15c authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland
Browse files

fs: dlm: call dlm_lsop_recover_prep once



A lockspace can be "stopped" multiple times consecutively before
being "started" (when recoveries overlap.)  In this case, the
lsop_recover_prep callback only needs to be called once when the
lockspace is first stopped, and not repeatedly for each stop.

Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent ca8031d9
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -679,7 +679,16 @@ int dlm_ls_stop(struct dlm_ls *ls)
	if (!ls->ls_recover_begin)
		ls->ls_recover_begin = jiffies;

	/* call recover_prep ops only once and not multiple times
	 * for each possible dlm_ls_stop() when recovery is already
	 * stopped.
	 *
	 * If we successful was able to clear LSFL_RUNNING bit and
	 * it was set we know it is the first dlm_ls_stop() call.
	 */
	if (new)
		dlm_lsop_recover_prep(ls);

	return 0;
}