scsi: libfc: fix seconds_since_last_reset miscalculation
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 17 Nov 2016 11:50:23 +0000 (12:50 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 18 Nov 2016 01:44:51 +0000 (20:44 -0500)
Commit 540eb1eef0ab ("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.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: <stable@vger.kernel.org> # v4.8+
Fixes: 540eb1eef0ab ("scsi: libfc: fix seconds_since_last_reset calculation")
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_lport.c

index 04ce7cfb6d1b6272d26ce138a9b11ee952a20d6f..50c71678a156e8f32d833575de49379e5cd3a151 100644 (file)
@@ -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;