Skip to contentSkip to conversation

HPA Problem in libata-core.c?

PATCH Richard Bland 1 participant 1 message May 16, 2008 libata

lore
Share & tools
lore
#0 lore raw

Hi Jeff,

Apologies if I'm way off-base here, but I was having problems unlocking a HPA and took a look at the above.

It seemed the code was bailing before it unlocked the HPA, but would appreciate your feedback.

Cheers,

Rich

libata-core.c renamed from libata-core.c~ +3 -2
@@ -1243,13 +1243,14 @@
 				"HPA detected: current %llu, native %llu\n",
 				(unsigned long long)sectors,
 				(unsigned long long)native_sectors);
-		else if (native_sectors < sectors)
+		else if (native_sectors < sectors) {
 			ata_dev_printk(dev, KERN_WARNING,
 				"native sectors (%llu) is smaller than "
 				"sectors (%llu)\n",
 				(unsigned long long)native_sectors,
 				(unsigned long long)sectors);
-		return 0;
+			return 0;
+		}
 	}
 
 	/* let's unlock HPA */