]> err.no Git - linux-2.6/commitdiff
libata: don't check n_sectors during revalidation if zero
authorTejun Heo <htejun@gmail.com>
Fri, 17 Aug 2007 09:46:51 +0000 (18:46 +0900)
committerJeff Garzik <jeff@garzik.org>
Thu, 23 Aug 2007 09:34:05 +0000 (05:34 -0400)
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>
drivers/ata/libata-core.c

index 9bfe329fb579a3e4ffd20072c23ae5bba7b5e0d9..2ad4dda6d4a780e13e1814296ead50ed1dd0774f 100644 (file)
@@ -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,