Skip to content

Commit 208da78

Browse files
Johannes Thumshirnmartinkpetersen
authored andcommitted
scsi: libfc: fix seconds_since_last_reset miscalculation
Commit 540eb1e ("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: 540eb1e ("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>
1 parent c733ab3 commit 208da78

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/libfc/fc_lport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost)
308308
fc_stats = &lport->host_stats;
309309
memset(fc_stats, 0, sizeof(struct fc_host_statistics));
310310

311-
fc_stats->seconds_since_last_reset = (lport->boot_time - jiffies) / HZ;
311+
fc_stats->seconds_since_last_reset = (jiffies - lport->boot_time) / HZ;
312312

313313
for_each_possible_cpu(cpu) {
314314
struct fc_stats *stats;

0 commit comments

Comments
 (0)