summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-17 11:46:51 +0200
committerJeff Garzik <jeff@garzik.org>2007-08-23 11:34:05 +0200
commitb54eebd673861136291b97e409a0f248b96e74ae (patch)
tree14ec79b827824ddd26fef89ac2db7324f7ada7fd /drivers/ata
parentpata_via: Add Arima W730-K8 and other rebadgings (diff)
downloadlinux-b54eebd673861136291b97e409a0f248b96e74ae.tar.xz
linux-b54eebd673861136291b97e409a0f248b96e74ae.zip
libata: don't check n_sectors during revalidation if zero
If the initial configuration fails early, n_sectors is left at zero. Checking against it during revalidation makes retried configuration fail due to n_sectors mismatch. Ignore zero n_sectors during revalidation. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9bfe329fb579..2ad4dda6d4a7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3700,7 +3700,8 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags)
goto fail;
/* verify n_sectors hasn't changed */
- if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) {
+ if (dev->class == ATA_DEV_ATA && n_sectors &&
+ dev->n_sectors != n_sectors) {
ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch "
"%llu != %llu\n",
(unsigned long long)n_sectors,