Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1418075 > unrolled thread

[PATCH 14/21] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds()

Started byDeepa Dinamani <deepa.kernel@gmail.com>
First post2016-06-09 07:10 +0200
Last post2016-06-09 07:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 14/21] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-09 07:10 +0200

#1418075 — [PATCH 14/21] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds()

FromDeepa Dinamani <deepa.kernel@gmail.com>
Date2016-06-09 07:10 +0200
Subject[PATCH 14/21] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds()
Message-ID<rI0oa-1PH-33@gated-at.bofh.it>
CURRENT_TIME is not y2038 safe.

Use y2038 safe ktime_get_real_seconds() here for timestamps.

struct heartbeat_block's hb_seq is already 64 bits wide and
accommodates times beyond y2038.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel@oss.oracle.com
---
 fs/ocfs2/cluster/heartbeat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 6aaf3e3..d13c646 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -737,7 +737,7 @@ static inline void o2hb_prepare_block(struct o2hb_region *reg,
 	hb_block = (struct o2hb_disk_heartbeat_block *)slot->ds_raw_block;
 	memset(hb_block, 0, reg->hr_block_bytes);
 	/* TODO: time stuff */
-	cputime = CURRENT_TIME.tv_sec;
+	cputime = ktime_get_real_seconds();
 	if (!cputime)
 		cputime = 1;
 
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web