]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_mdrestore: fix missed progress reporting
authorDarrick J. Wong <djwong@kernel.org>
Wed, 20 Dec 2023 16:53:45 +0000 (08:53 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 22 Dec 2023 02:29:14 +0000 (18:29 -0800)
commitabb66bd7bd856ea6c6d552f3125ea84855038123
treeed77f42f72a62a813d4ba01abd72d6eeec480cfe
parentc0c39802f70c3fedd1038742782c59e9a28ea7d1
xfs_mdrestore: fix missed progress reporting

Currently, the progress reporting only triggers when the number of bytes
read is exactly a multiple of a megabyte.  This isn't always guaranteed,
since AG headers can be 512 bytes in size.  Fix the algorithm by
recording the number of megabytes we've reported as being read, and emit
a new report any time the bytes_read count, once converted to megabytes,
doesn't match.

Fix the v2 code to emit one final status message in case the last
extent restored is more than a megabyte.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chandan Babu R <chandanbabu@kernel.org>
mdrestore/xfs_mdrestore.c