public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coredump: Use 64bit time for unix time of coredump
@ 2015-11-25 15:22 Arnd Bergmann
  2015-11-25 16:16 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2015-11-25 15:22 UTC (permalink / raw)
  To: Alexander Viro, linux-fsdevel, Andrew Morton
  Cc: Tina Ruchandani, y2038, linux-kernel, tglx, john.stultz

struct timeval on 32-bit systems will have its tv_sec
value overflow in year 2038 and beyond.
Use a 64 bit value to print time of the coredump in seconds.
ktime_get_real_seconds is chosen here for efficiency reasons.

Suggested by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I've had this patch in my queue for a while, and would like for
someone to pick it up into mainline.

Andrew Morton seems to be the one who has handled most of the
coredump.c patches. Andrew, can you take this for 4.5?

My tree is part of linux-next, so I assume I have to drop it
before you can take it into -mm?

Alternatively, Al could take it for his vfs tree, or Thomas
or John for the timekeeping branch in tip.

diff --git a/fs/coredump.c b/fs/coredump.c
index 1777331eee76..b3c153ca435d 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -32,6 +32,7 @@
 #include <linux/pipe_fs_i.h>
 #include <linux/oom.h>
 #include <linux/compat.h>
+#include <linux/timekeeping.h>
 
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
@@ -232,9 +233,10 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm)
 				break;
 			/* UNIX time of coredump */
 			case 't': {
-				struct timeval tv;
-				do_gettimeofday(&tv);
-				err = cn_printf(cn, "%lu", tv.tv_sec);
+				time64_t time;
+
+				time = ktime_get_real_seconds();
+				err = cn_printf(cn, "%lld", time);
 				break;
 			}
 			/* hostname */


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] coredump: Use 64bit time for unix time of coredump
  2015-11-25 15:22 [PATCH] coredump: Use 64bit time for unix time of coredump Arnd Bergmann
@ 2015-11-25 16:16 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2015-11-25 16:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-fsdevel, Andrew Morton, Tina Ruchandani, y2038,
	linux-kernel, tglx, john.stultz

On Wed, Nov 25, 2015 at 04:22:25PM +0100, Arnd Bergmann wrote:
> struct timeval on 32-bit systems will have its tv_sec
> value overflow in year 2038 and beyond.
> Use a 64 bit value to print time of the coredump in seconds.
> ktime_get_real_seconds is chosen here for efficiency reasons.
> 
> Suggested by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I've had this patch in my queue for a while, and would like for
> someone to pick it up into mainline.

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-25 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 15:22 [PATCH] coredump: Use 64bit time for unix time of coredump Arnd Bergmann
2015-11-25 16:16 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox