btrfs-progs: scrub: fix ETA calculation

ETA is calculated in a wrong way. It should be just current time in
seconds + sec_left, independently if the job was resumed or not.

Pull-request: #190
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Grzegorz Kowal 2019-07-07 14:58:56 -03:00 committed by David Sterba
parent df090f6eb7
commit 96ed8e801f
1 changed files with 1 additions and 4 deletions

View File

@ -164,10 +164,7 @@ static void print_scrub_summary(struct btrfs_scrub_progress *p, struct scrub_sta
char t[4096];
struct tm tm;
if (s->t_resumed)
sec_eta = s->t_resumed;
else
sec_eta = s->t_start;
sec_eta = time(NULL);
sec_eta += sec_left;
localtime_r(&sec_eta, &tm);
t[sizeof(t) - 1] = '\0';