From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id EA20F29DF9 for ; Thu, 4 Feb 2016 17:03:05 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 72C40AC005 for ; Thu, 4 Feb 2016 15:03:02 -0800 (PST) Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 9FzCObN2bDgXFtEV for ; Thu, 04 Feb 2016 15:02:56 -0800 (PST) Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1aRStY-0000DA-Su for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 Received: from dave by disappointment with local (Exim 4.86) (envelope-from ) id 1aRStY-0004vh-SR for xfs@oss.sgi.com; Fri, 05 Feb 2016 10:01:00 +1100 From: Dave Chinner Subject: [PATCH 3/3] xfs_mdrestore: correctly account bytes read Date: Fri, 5 Feb 2016 10:00:58 +1100 Message-Id: <1454626858-17823-4-git-send-email-david@fromorbit.com> In-Reply-To: <1454626858-17823-1-git-send-email-david@fromorbit.com> References: <1454626858-17823-1-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com From: Dave Chinner Progess indication comes in the form of a "X MB read" output. This doesn't match up with the actual number of bytes read from the metadump file because it only accounts header blocks in the file, not actual metadata blocks that are restored, Hence the number reported is usually much lower than the size of the metadump file, hence it's impossible to use to gauge progress of the restore. While there, fix the progress output so that it overwrites the previous progress output line correctly. Signed-off-by: Dave Chinner Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- mdrestore/xfs_mdrestore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index ebc5e54..70a160c 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -133,7 +133,7 @@ perform_restore( for (;;) { if (show_progress && (bytes_read & ((1 << 20) - 1)) == 0) - print_progress("%lld MB read\n", bytes_read >> 20); + print_progress("%lld MB read", bytes_read >> 20); for (cur_index = 0; cur_index < mb_count; cur_index++) { if (pwrite64(dst_fd, &block_buffer[cur_index << @@ -160,7 +160,7 @@ perform_restore( 1, src_f) != 1) fatal("error reading from file: %s\n", strerror(errno)); - bytes_read += block_size; + bytes_read += block_size + (mb_count << tmb.mb_blocklog); } if (progress_since_warning) -- 2.5.0 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs