From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z47-0003AQ-Nc for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:20:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Z3t-0007Pn-Fj for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:20:27 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:60257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z3t-0007Ov-4U for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:20:13 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 11:20:12 -0600 From: Michael Roth Date: Tue, 8 Jul 2014 12:16:50 -0500 Message-Id: <1404839947-1086-20-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 019/156] ide: Correct improper smart self test counter reset in ide core. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: BenoƮt Canet The SMART self test counter was incorrectly being reset to zero, not 1. This had the effect that on every 21st SMART EXECUTE OFFLINE: * We would write off the beginning of a dynamically allocated buffer * We forgot the SMART history Fix this. Signed-off-by: Benoit Canet Message-id: 1397336390-24664-1-git-send-email-benoit.canet@irqsave.net Reviewed-by: Markus Armbruster Cc: qemu-stable@nongnu.org Acked-by: Kevin Wolf [PMM: tweaked commit message as per suggestions from Markus] Signed-off-by: Peter Maydell (cherry picked from commit 940973ae0b45c9b6817bab8e4cf4df99a9ef83d7) Signed-off-by: Michael Roth --- hw/ide/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index e1f4c33..6007f6f 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1601,7 +1601,7 @@ static bool cmd_smart(IDEState *s, uint8_t cmd) case 2: /* extended self test */ s->smart_selftest_count++; if (s->smart_selftest_count > 21) { - s->smart_selftest_count = 0; + s->smart_selftest_count = 1; } n = 2 + (s->smart_selftest_count - 1) * 24; s->smart_selftest_data[n] = s->sector; -- 1.9.1