All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: netdev@vger.kernel.org, y2038@lists.linaro.org, arnd@arndb.de,
	Vlad Yasevich <vyasevich@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-sctp@vger.kernel.org
Subject: Re: [PATCH 4/4] net: sctp: Convert log timestamps to be y2038 safe
Date: Thu, 25 Feb 2016 09:09:19 -0500	[thread overview]
Message-ID: <20160225140919.GA20042@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1456384031-29244-5-git-send-email-deepa.kernel@gmail.com>

On Wed, Feb 24, 2016 at 11:07:11PM -0800, Deepa Dinamani wrote:
> SCTP probe log timestamps use struct timespec which is
> not y2038 safe.
> Use struct timespec64 which is 2038 safe instead.
> 
> Use monotonic time instead of real time as only time
> differences are logged.
> 
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: linux-sctp@vger.kernel.org
> ---
>  net/sctp/probe.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/net/sctp/probe.c b/net/sctp/probe.c
> index 5e68b94..6cc2152 100644
> --- a/net/sctp/probe.c
> +++ b/net/sctp/probe.c
> @@ -65,7 +65,7 @@ static struct {
>  	struct kfifo	  fifo;
>  	spinlock_t	  lock;
>  	wait_queue_head_t wait;
> -	struct timespec	  tstart;
> +	struct timespec64 tstart;
>  } sctpw;
>  
>  static __printf(1, 2) void printl(const char *fmt, ...)
> @@ -85,7 +85,7 @@ static __printf(1, 2) void printl(const char *fmt, ...)
>  static int sctpprobe_open(struct inode *inode, struct file *file)
>  {
>  	kfifo_reset(&sctpw.fifo);
> -	getnstimeofday(&sctpw.tstart);
> +	ktime_get_ts64(&sctpw.tstart);
>  
>  	return 0;
>  }
> @@ -138,7 +138,7 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
>  	struct sk_buff *skb = chunk->skb;
>  	struct sctp_transport *sp;
>  	static __u32 lcwnd = 0;
> -	struct timespec now;
> +	struct timespec64 now;
>  
>  	sp = asoc->peer.primary_path;
>  
> @@ -149,8 +149,8 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
>  	    (full || sp->cwnd != lcwnd)) {
>  		lcwnd = sp->cwnd;
>  
> -		getnstimeofday(&now);
> -		now = timespec_sub(now, sctpw.tstart);
> +		ktime_get_ts64(&now);
> +		now = timespec64_sub(now, sctpw.tstart);
>  
>  		printl("%lu.%06lu ", (unsigned long) now.tv_sec,
>  		       (unsigned long) now.tv_nsec / NSEC_PER_USEC);
> -- 
> 1.9.1
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

WARNING: multiple messages have this Message-ID (diff)
From: Neil Horman <nhorman@tuxdriver.com>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: netdev@vger.kernel.org, y2038@lists.linaro.org, arnd@arndb.de,
	Vlad Yasevich <vyasevich@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-sctp@vger.kernel.org
Subject: Re: [PATCH 4/4] net: sctp: Convert log timestamps to be y2038 safe
Date: Thu, 25 Feb 2016 14:09:19 +0000	[thread overview]
Message-ID: <20160225140919.GA20042@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1456384031-29244-5-git-send-email-deepa.kernel@gmail.com>

On Wed, Feb 24, 2016 at 11:07:11PM -0800, Deepa Dinamani wrote:
> SCTP probe log timestamps use struct timespec which is
> not y2038 safe.
> Use struct timespec64 which is 2038 safe instead.
> 
> Use monotonic time instead of real time as only time
> differences are logged.
> 
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: linux-sctp@vger.kernel.org
> ---
>  net/sctp/probe.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/net/sctp/probe.c b/net/sctp/probe.c
> index 5e68b94..6cc2152 100644
> --- a/net/sctp/probe.c
> +++ b/net/sctp/probe.c
> @@ -65,7 +65,7 @@ static struct {
>  	struct kfifo	  fifo;
>  	spinlock_t	  lock;
>  	wait_queue_head_t wait;
> -	struct timespec	  tstart;
> +	struct timespec64 tstart;
>  } sctpw;
>  
>  static __printf(1, 2) void printl(const char *fmt, ...)
> @@ -85,7 +85,7 @@ static __printf(1, 2) void printl(const char *fmt, ...)
>  static int sctpprobe_open(struct inode *inode, struct file *file)
>  {
>  	kfifo_reset(&sctpw.fifo);
> -	getnstimeofday(&sctpw.tstart);
> +	ktime_get_ts64(&sctpw.tstart);
>  
>  	return 0;
>  }
> @@ -138,7 +138,7 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
>  	struct sk_buff *skb = chunk->skb;
>  	struct sctp_transport *sp;
>  	static __u32 lcwnd = 0;
> -	struct timespec now;
> +	struct timespec64 now;
>  
>  	sp = asoc->peer.primary_path;
>  
> @@ -149,8 +149,8 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
>  	    (full || sp->cwnd != lcwnd)) {
>  		lcwnd = sp->cwnd;
>  
> -		getnstimeofday(&now);
> -		now = timespec_sub(now, sctpw.tstart);
> +		ktime_get_ts64(&now);
> +		now = timespec64_sub(now, sctpw.tstart);
>  
>  		printl("%lu.%06lu ", (unsigned long) now.tv_sec,
>  		       (unsigned long) now.tv_nsec / NSEC_PER_USEC);
> -- 
> 1.9.1
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>


  reply	other threads:[~2016-02-25 14:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  7:07 [PATCH 0/4] Convert network timestamps to be y2038 safe Deepa Dinamani
2016-02-25  7:07 ` Deepa Dinamani
2016-02-25  7:07 ` [PATCH 1/4] kernel: time: Add current_nw_timestamp() for network timestamps Deepa Dinamani
2016-02-25  8:49   ` YOSHIFUJI Hideaki
2016-02-25  9:45     ` Deepa Dinamani
2016-02-26  6:49       ` YOSHIFUJI Hideaki/吉藤英明
2016-02-25 14:56   ` [Y2038] " Arnd Bergmann
2016-02-25  7:07 ` [PATCH 2/4] net: ipv4: Use y2038 safe functions and data structures Deepa Dinamani
2016-02-25 14:57   ` Arnd Bergmann
2016-02-25  7:07 ` [PATCH 3/4] net: ipv4: tcp_probe: Replace timespec with timespec64 Deepa Dinamani
2016-02-25 15:01   ` Arnd Bergmann
2016-02-27  2:56     ` Deepa Dinamani
2016-02-25  7:07 ` [PATCH 4/4] net: sctp: Convert log timestamps to be y2038 safe Deepa Dinamani
2016-02-25  7:07   ` Deepa Dinamani
2016-02-25 14:09   ` Neil Horman [this message]
2016-02-25 14:09     ` Neil Horman
2016-02-25 14:56   ` [Y2038] " Arnd Bergmann
2016-02-25 14:56     ` Arnd Bergmann
2016-02-26 20:19 ` [PATCH 0/4] Convert network " David Miller
2016-02-26 20:19   ` David Miller

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=20160225140919.GA20042@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.com \
    --cc=y2038@lists.linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.