All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] libfc: fix seconds_since_last_reset miscalculation
@ 2016-11-17 12:39 Johannes Thumshirn
  2016-11-17 13:48 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2016-11-17 12:39 UTC (permalink / raw)
  To: Martin K . Petersen, James Bottomley
  Cc: Arnd Bergmann, Bart Van Assche, Linux SCSI Mailinglist,
	Johannes Thumshirn

Commit 540eb1eef 'scsi: libfc: fix seconds_since_last_reset calculation'
removed the use of 'struct timespec' from fc_get_host_stats(). This broke the
output of 'fcoeadm -s' after kernel 4.8-rc1.

Fixes: 540eb1eef ('scsi: libfc: fix seconds_since_last_reset calculation')
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/libfc/fc_lport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 04ce7cf..50c7167 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -308,7 +308,7 @@ struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost)
 	fc_stats = &lport->host_stats;
 	memset(fc_stats, 0, sizeof(struct fc_host_statistics));
 
-	fc_stats->seconds_since_last_reset = (lport->boot_time - jiffies) / HZ;
+	fc_stats->seconds_since_last_reset = (jiffies - lport->boot_time) / HZ;
 
 	for_each_possible_cpu(cpu) {
 		struct fc_stats *stats;
-- 
1.8.5.6


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

* Re: [PATCH v2] libfc: fix seconds_since_last_reset miscalculation
  2016-11-17 12:39 [PATCH v2] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn
@ 2016-11-17 13:48 ` Arnd Bergmann
  2016-11-17 17:40 ` Bart Van Assche
  2016-11-18  1:21 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-11-17 13:48 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Martin K . Petersen, James Bottomley, Bart Van Assche,
	Linux SCSI Mailinglist

On Thursday, November 17, 2016 1:39:27 PM CET Johannes Thumshirn wrote:
> Commit 540eb1eef 'scsi: libfc: fix seconds_since_last_reset calculation'
> removed the use of 'struct timespec' from fc_get_host_stats(). This broke the
> output of 'fcoeadm -s' after kernel 4.8-rc1.
> 
> Fixes: 540eb1eef ('scsi: libfc: fix seconds_since_last_reset calculation')
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

I actually made the same patch today and was going to send it out
after getting my other patches to build cleanly, but you were faster.

Are we worried about 32-bit systems overflowing here when the elapsed
time since the last reset is over 49 days? If we are, we probably
want another patch on top, though this one is sufficient to fix
the regression, and it has no problems on 64-bit machines.

	Arnd

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

* Re: [PATCH v2] libfc: fix seconds_since_last_reset miscalculation
  2016-11-17 12:39 [PATCH v2] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn
  2016-11-17 13:48 ` Arnd Bergmann
@ 2016-11-17 17:40 ` Bart Van Assche
  2016-11-18  1:21 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2016-11-17 17:40 UTC (permalink / raw)
  To: Johannes Thumshirn, Martin K . Petersen, James Bottomley
  Cc: Arnd Bergmann, Linux SCSI Mailinglist

On 11/17/2016 04:39 AM, Johannes Thumshirn wrote:
> Commit 540eb1eef 'scsi: libfc: fix seconds_since_last_reset calculation'
> removed the use of 'struct timespec' from fc_get_host_stats(). This broke the
> output of 'fcoeadm -s' after kernel 4.8-rc1.

Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>

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

* Re: [PATCH v2] libfc: fix seconds_since_last_reset miscalculation
  2016-11-17 12:39 [PATCH v2] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn
  2016-11-17 13:48 ` Arnd Bergmann
  2016-11-17 17:40 ` Bart Van Assche
@ 2016-11-18  1:21 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-11-18  1:21 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Martin K . Petersen, James Bottomley, Arnd Bergmann,
	Bart Van Assche, Linux SCSI Mailinglist

>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:

Johannes> Commit 540eb1eef 'scsi: libfc: fix seconds_since_last_reset
Johannes> calculation' removed the use of 'struct timespec' from
Johannes> fc_get_host_stats(). This broke the output of 'fcoeadm -s'
Johannes> after kernel 4.8-rc1.

Applied to 4.9/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2016-11-18  1:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17 12:39 [PATCH v2] libfc: fix seconds_since_last_reset miscalculation Johannes Thumshirn
2016-11-17 13:48 ` Arnd Bergmann
2016-11-17 17:40 ` Bart Van Assche
2016-11-18  1:21 ` Martin K. Petersen

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.