cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: tsutomu.owa@toshiba.co.jp <tsutomu.owa@toshiba.co.jp>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 15/18] [try #2] DLM: fix overflow dlm_cb_seq
Date: Tue, 12 Sep 2017 09:01:46 +0000	[thread overview]
Message-ID: <7c3bf9f6d55d4c7fa1536814d5d2c110@TGXML394.toshiba.local> (raw)

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 <miyauchi@toshiba-tops.co.jp>
Signed-off-by: Tsutomu Owa <tsutomu.owa@toshiba.co.jp>
---
 fs/dlm/ast.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index 07fed83..562fa8c 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -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) {
-- 
2.7.4







                 reply	other threads:[~2017-09-12  9:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c3bf9f6d55d4c7fa1536814d5d2c110@TGXML394.toshiba.local \
    --to=tsutomu.owa@toshiba.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).