linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: linux-raid@vger.kernel.org
Cc: Jes.Sorensen@redhat.com, deepa.kernel@gmail.com, maxin.john@gmail.com
Subject: [mdadm PATCH 1/1] Fix some type comparison problems
Date: Sat,  6 Feb 2016 09:18:41 +0800	[thread overview]
Message-ID: <1454721521-7118-1-git-send-email-xni@redhat.com> (raw)

As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed 
timestamps will overflow in the year 2038. It already changed the
utime and ctime in struct mdu_array_info_s from int to unsigned 
int. So we need to change the values that compared with them to
unsigned int too.

Signed-off-by : Xiao Ni <xni@redhat.com>
---
 Monitor.c | 2 +-
 util.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Monitor.c b/Monitor.c
index f19c2e5..6df80f9 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -33,7 +33,7 @@
 struct state {
 	char *devname;
 	char devnm[32];	/* to sync with mdstat info */
-	long utime;
+	unsigned int utime;
 	int err;
 	char *spare_group;
 	int active, working, failed, spare, raid;
diff --git a/util.c b/util.c
index 970d484..6e7d3fb 100644
--- a/util.c
+++ b/util.c
@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
 	 */
 	struct superswitch  *ss;
 	struct supertype *st;
-	time_t besttime = 0;
+	unsigned int besttime = 0;
 	int bestsuper = -1;
 	int i;
 
-- 
2.4.3


             reply	other threads:[~2016-02-06  1:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06  1:18 Xiao Ni [this message]
2016-02-08 15:51 ` [mdadm PATCH 1/1] Fix some type comparison problems Jes Sorensen
  -- strict thread matches above, loose matches on Subject: below --
2016-02-04 12:26 Xiao Ni
2016-02-04 13:12 ` Jes Sorensen
2016-02-03  5:24 Xiao Ni
2016-02-03 20:36 ` Jes Sorensen
2016-02-04  3:10   ` Deepa Dinamani

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=1454721521-7118-1-git-send-email-xni@redhat.com \
    --to=xni@redhat.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=maxin.john@gmail.com \
    /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).