Skip to content

Commit

Permalink
DLM: fix overflow dlm_cb_seq
Browse files Browse the repository at this point in the history
dlm_cb_seq is 64 bits. If dlm_cb_seq overflows and returns to 0,
dlm_rem_lkb_callback() will not work properly.

Signed-off-by: Tadashi Miyauchi <[email protected]>
Signed-off-by: Tsutomu Owa <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
[email protected] authored and teigland committed Sep 25, 2017
1 parent 3421fb1 commit ccbbea0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/dlm/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,

spin_lock(&dlm_cb_seq_spin);
new_seq = ++dlm_cb_seq;
if (!dlm_cb_seq)
new_seq = ++dlm_cb_seq;
spin_unlock(&dlm_cb_seq_spin);

if (lkb->lkb_flags & DLM_IFL_USER) {
Expand Down

0 comments on commit ccbbea0

Please sign in to comment.