From patchwork Sat Jan 23 19:18:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 43583 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 162E6B6EF4 for ; Sun, 24 Jan 2010 06:19:46 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413Ab0AWTTo (ORCPT ); Sat, 23 Jan 2010 14:19:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752796Ab0AWTTo (ORCPT ); Sat, 23 Jan 2010 14:19:44 -0500 Received: from rcsinet11.oracle.com ([148.87.113.123]:44928 "EHLO rcsinet11.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413Ab0AWTTo (ORCPT ); Sat, 23 Jan 2010 14:19:44 -0500 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o0NJJeCt006176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 23 Jan 2010 19:19:41 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o0NJJdEj001265; Sat, 23 Jan 2010 19:19:39 GMT Received: from abhmt006.oracle.com by acsmt354.oracle.com with ESMTP id 1431819791264274293; Sat, 23 Jan 2010 11:18:13 -0800 Received: from groovelator.mkp.net (/209.217.122.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 23 Jan 2010 11:18:13 -0800 To: Mark Lord Cc: linux-ide@vger.kernel.org Subject: [PATCH] hdparm: Fix error in sector offset reporting From: "Martin K. Petersen" Organization: Oracle Date: Sat, 23 Jan 2010 14:18:11 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4B5B4BCC.011B:SCFMA4539814,ss=1,fgs=0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The sector offset reporting is off by a factor of two... Signed-off-by: Martin K. Petersen --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -urN -X /home/mkp/bin/dontdiff hdparm-9.27.orig/identify.c hdparm-9.27/identify.c --- hdparm-9.27.orig/identify.c 2009-08-20 10:31:01.000000000 -0400 +++ hdparm-9.27/identify.c 2010-01-23 14:07:43.000000000 -0500 @@ -938,7 +938,7 @@ printf("\t%-31s %11u bytes\n","Physical Sector size:", sector_bytes * pfactor); if ((val[209] & 0xc000) == 0x4000) { unsigned int offset = val[209] & 0x1fff; - printf("\t%-31s %11u bytes\n", "Logical Sector-0 offset:", offset * lsize); + printf("\t%-31s %11u bytes\n", "Logical Sector-0 offset:", offset * sector_bytes); } } if (!bbbig) bbbig = (__u64)(ll>mm ? ll : mm); /* # 512 byte blocks */