From patchwork Fri Oct 30 08:24:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tina Ruchandani X-Patchwork-Id: 538202 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 687E5140D92 for ; Fri, 30 Oct 2015 19:27:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=v2qttNgX; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759160AbbJ3I0X (ORCPT ); Fri, 30 Oct 2015 04:26:23 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:32900 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758340AbbJ3IZI (ORCPT ); Fri, 30 Oct 2015 04:25:08 -0400 Received: by padhy1 with SMTP id hy1so61772010pad.0; Fri, 30 Oct 2015 01:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=qBuUEQDlmqGpxcLxy7cp5eNVvzq3f6tf7v6qeJSq6po=; b=v2qttNgXtGTleyTZAWsJT4lSOowP9uiyCd79W/0IqRvdE4N74yE92K6ah/N2rQVVNj VLHJ63FsJuiHfkjXe/qCIqG52nrZdcxfWJ9VCwbrGT2bR0wYLvbyvPfCNU8tq0WlKlv0 9RMzThX2Mt8H2pPDQsjsgX+FzJBLINKgQ0ALSLMiw7P5KVlqbCetPJy2KOmaynV+rnZ/ 1YcC+iY+qQEZKIbn6OGb8T3KasV9vgL43ZTDMlYTQg20GE6IjOckPH9JemqNXYiA5TtF w8UvFlbZpRX97QVE8WmkYN370E35iS4Dt7mMtnIMQn50PxrPXvG9OcPkNyKIeTrmTAE9 CRlg== X-Received: by 10.66.185.228 with SMTP id ff4mr4663997pac.79.1446193508070; Fri, 30 Oct 2015 01:25:08 -0700 (PDT) Received: from tina-laptop ([2602:301:779f:31e0:dcc6:66f6:ae0d:2aff]) by smtp.gmail.com with ESMTPSA id dg2sm6673366pbb.9.2015.10.30.01.25.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Oct 2015 01:25:07 -0700 (PDT) Date: Fri, 30 Oct 2015 01:24:56 -0700 From: Tina Ruchandani To: dccp@vger.kernel.org Cc: arnd@arndb.de, y2038@lists.linaro.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [DCCP]: Use 64-bit timekeeping Message-ID: <20151030082456.GA31370@tina-laptop> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch changes the use of struct timespec in dccp_probe to use struct timespec64 instead. timespec uses a 32-bit seconds field which will overflow in the year 2038 and beyond. timespec64 uses a 64-bit seconds field. Note that the correctness of the code isn't changed, since the original code only uses the timestamps to compute a small elapsed interval. This patch is part of a larger attempt to remove instances of 32-bit timekeeping structures (timespec, timeval, time_t) from the kernel so it is easier to identify where the real 2038 issues are. Signed-off-by: Tina Ruchandani --- net/dccp/probe.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/dccp/probe.c b/net/dccp/probe.c index d8346d0..3d3fda0 100644 --- a/net/dccp/probe.c +++ b/net/dccp/probe.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -47,20 +48,20 @@ static struct { struct kfifo fifo; spinlock_t lock; wait_queue_head_t wait; - struct timespec tstart; + struct timespec64 tstart; } dccpw; static void printl(const char *fmt, ...) { va_list args; int len; - struct timespec now; + struct timespec64 now; char tbuf[256]; va_start(args, fmt); - getnstimeofday(&now); + getnstimeofday64(&now); - now = timespec_sub(now, dccpw.tstart); + now = timespec64_sub(now, dccpw.tstart); len = sprintf(tbuf, "%lu.%06lu ", (unsigned long) now.tv_sec, @@ -110,7 +111,7 @@ static struct jprobe dccp_send_probe = { static int dccpprobe_open(struct inode *inode, struct file *file) { kfifo_reset(&dccpw.fifo); - getnstimeofday(&dccpw.tstart); + getnstimeofday64(&dccpw.tstart); return 0; }