Skip to contentSkip to conversation

hdparm: Fix error in sector offset reporting

PATCH Applied Martin K. Petersen 2 participants 2 messages Jan 23, 2010 – Jan 24, 2010 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hdparm: Fix error in sector offset reporting

The sector offset reporting is off by a factor of two...

identify.c +1 -1
diff -urN -X /home/mkp/bin/dontdiff hdparm-9.27.orig/identify.c hdparm-9.27/identify.c
@@ -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 */
Applied
#1 lore raw

identify.c line 941

Quoted 13 lines · Martin K. Petersen

The sector offset reporting is off by a factor of two...

diff -urN -X /home/mkp/bin/dontdiff hdparm-9.27.orig/identify.c hdparm-9.27/identify.c

identify.c +1 -1
@@ -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);

..

Thanks, applied. I *like* easy fixes like that!

-ml