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


Groups > linux.kernel > #1522476

Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation

From Johannes Thumshirn <jthumshirn@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation
Date 2016-11-15 10:20 +0100
Message-ID <sDI4i-30U-29@gated-at.bofh.it> (permalink)
References <sBagq-739-29@gated-at.bofh.it> <sBhBg-3jW-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 08, 2016 at 03:04:43PM +0000, Bart Van Assche wrote:

[...]

> Hello Johannes,
> 
> I think the above code will miscalculate seconds_since_last_reset if 
> 'jiffies' wraps around after an lport has been created and before 
> seconds_since_last_reset is computed. Shouldn't seconds_since_last_reset 
> be computed as follows?
> 
> 	fc_stats->seconds_since_last_reset = (jiffies - boot_time) / HZ;

But what happens when jiffies - boot_time becomes negative? Then we
reintroduce the bug again and have 'fcoeadm -s' show weird values.

Byte,
	Johannes
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn <jthumshirn@suse.de> - 2016-11-15 10:20 +0100
  Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation Bart Van Assche <Bart.VanAssche@sandisk.com> - 2016-11-15 16:00 +0100
    Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn <jthumshirn@suse.de> - 2016-11-15 16:10 +0100
      Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation Arnd Bergmann <arnd@arndb.de> - 2016-11-16 18:00 +0100
        Re: [PATCH] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn <jthumshirn@suse.de> - 2016-11-17 09:20 +0100

csiph-web