]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: fix progress reporting
authorEric Sandeen <sandeen@redhat.com>
Tue, 26 May 2020 18:36:04 +0000 (14:36 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 26 May 2020 18:36:04 +0000 (14:36 -0400)
commita4d94d6c30acac66ff82e740e2dcb95736d7d195
treeb301c932d4c4dd9a6f336915e04f132785fb184f
parent981e63e0ebca1f6de45dd1a2a77736b510dfbe3d
xfs_repair: fix progress reporting

The Fixes: commit tried to avoid a segfault in case the progress timer
went off before the first message type had been set up, but this
had the net effect of short-circuiting the pthread start routine,
and so the timer didn't get set up at all and we lost all fine-grained
progress reporting.

The initial problem occurred when log zeroing took more time than the
timer interval.

So, make a new log zeroing progress item and initialize it when we first
set up the timer thread, to be sure that if the timer goes off while we
are still zeroing the log, it will be initialized and correct.

(We can't offer fine-grained status on log zeroing, so it'll go from
zero to $LOGBLOCKS with nothing in between, but it's unlikely that log
zeroing will take so long that this really matters.)

Reported-by: Leonardo Vaz <lvaz@redhat.com>
Fixes: 7f2d6b811755 ("xfs_repair: avoid segfault if reporting progre...")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Donald Douwsma <ddouwsma@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase2.c
repair/progress.c
repair/progress.h