forked from Mirrors/btrfs-progs
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
parent
df090f6eb7
commit
96ed8e801f
|
@ -164,10 +164,7 @@ static void print_scrub_summary(struct btrfs_scrub_progress *p, struct scrub_sta
|
||||||
char t[4096];
|
char t[4096];
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
if (s->t_resumed)
|
sec_eta = time(NULL);
|
||||||
sec_eta = s->t_resumed;
|
|
||||||
else
|
|
||||||
sec_eta = s->t_start;
|
|
||||||
sec_eta += sec_left;
|
sec_eta += sec_left;
|
||||||
localtime_r(&sec_eta, &tm);
|
localtime_r(&sec_eta, &tm);
|
||||||
t[sizeof(t) - 1] = '\0';
|
t[sizeof(t) - 1] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue