Skip to content

Commit

Permalink
fs: dlm: call dlm_lsop_recover_prep once
Browse files Browse the repository at this point in the history
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: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Alexander Aring authored and teigland committed Jun 24, 2022
1 parent ca8031d commit 7e09b15
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fs/dlm/member.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,16 @@ int dlm_ls_stop(struct dlm_ls *ls)
if (!ls->ls_recover_begin)
ls->ls_recover_begin = jiffies;

dlm_lsop_recover_prep(ls);
/* 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;
}

Expand Down

0 comments on commit 7e09b15

Please sign in to comment.