From: Tejun Heo Date: Fri, 17 Aug 2007 09:46:51 +0000 (+0900) Subject: libata: don't check n_sectors during revalidation if zero X-Git-Tag: v2.6.23-rc4~20^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b54eebd673861136291b97e409a0f248b96e74ae;p=linux-2.6 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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 9bfe329fb5..2ad4dda6d4 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,