diff options
author | Tejun Heo <htejun@gmail.com> | 2007-08-15 20:02:22 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-08-23 11:23:14 +0200 |
commit | 8270bec40075eec9df8778c1d5da36ef0e535176 (patch) | |
tree | dcf47e96b54c29e8674b78c4f4acee32a1faa2cd /drivers/ata | |
parent | Apply memory policies to top two highest zones when highest zone is ZONE_MOVABLE (diff) | |
download | linux-8270bec40075eec9df8778c1d5da36ef0e535176.tar.xz linux-8270bec40075eec9df8778c1d5da36ef0e535176.zip |
libata: fix n_sectors failure handling during revalidation
If revalidation fails because device has different n_sectors after
configuration the original n_sectors should be restored before failing
revalidation. Without this fix, n_sectors difference will incorrectly
and silently pass revalidation when revalidation is retried.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 99d4fbffb0df..9bfe329fb579 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3705,6 +3705,10 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) "%llu != %llu\n", (unsigned long long)n_sectors, (unsigned long long)dev->n_sectors); + + /* restore original n_sectors */ + dev->n_sectors = n_sectors; + rc = -ENODEV; goto fail; } |