mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-13 17:21:05 +00:00
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>
This commit is contained in:
parent
df090f6eb7
commit
96ed8e801f
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user