From owner-svn-src-head@FreeBSD.ORG Fri Feb 25 13:59:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFACF106564A; Fri, 25 Feb 2011 13:59:59 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3DA8FC22; Fri, 25 Feb 2011 13:59:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1PDxxgr053384; Fri, 25 Feb 2011 13:59:59 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1PDxxT0053382; Fri, 25 Feb 2011 13:59:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201102251359.p1PDxxT0053382@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 25 Feb 2011 13:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219031 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2011 14:00:00 -0000 Author: pluknet Date: Fri Feb 25 13:59:59 2011 New Revision: 219031 URL: http://svn.freebsd.org/changeset/base/219031 Log: Fix division by zero, causing floating point exception in a drive progress command. It was possible to read a value of zero from a busy controller used as the divisor to calculate the remaining rebuild time. Reported by: Pavel Udovenko Discussed with: jhb Approved by: kib (mentor) MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_cmd.c Modified: head/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_cmd.c Fri Feb 25 12:46:43 2011 (r219030) +++ head/usr.sbin/mfiutil/mfi_cmd.c Fri Feb 25 13:59:59 2011 (r219031) @@ -316,7 +316,7 @@ mfi_display_progress(const char *label, printf("%s: %.2f%% complete, after %ds", label, (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds); - if (prog->elapsed_seconds > 10) { + if (prog->progress != 0 && prog->elapsed_seconds > 10) { printf(" finished in "); seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) / prog->progress - prog->elapsed_seconds;