Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: libfc: fix seconds_since_last_reset miscalculation

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>

authored by

Johannes Thumshirn and committed by
Martin K. Petersen
208da78e c733ab35

+1 -1
+1 -1
drivers/scsi/libfc/fc_lport.c
··· 308 308 fc_stats = &lport->host_stats; 309 309 memset(fc_stats, 0, sizeof(struct fc_host_statistics)); 310 310 311 - fc_stats->seconds_since_last_reset = (lport->boot_time - jiffies) / HZ; 311 + fc_stats->seconds_since_last_reset = (jiffies - lport->boot_time) / HZ; 312 312 313 313 for_each_possible_cpu(cpu) { 314 314 struct fc_stats *stats;