]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-gd.c
ide-gd: re-get capacity on revalidate
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-gd.c
index 7b6662854374ceb9f2e209b3633f4d49ebaad345..b8078b3231f7f9de114affcd3b4c5ced5e436728 100644 (file)
@@ -281,7 +281,12 @@ static int ide_gd_media_changed(struct gendisk *disk)
 static int ide_gd_revalidate_disk(struct gendisk *disk)
 {
        struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
-       set_capacity(disk, ide_gd_capacity(idkp->drive));
+       ide_drive_t *drive = idkp->drive;
+
+       if (ide_gd_media_changed(disk))
+               drive->disk_ops->get_capacity(drive);
+
+       set_capacity(disk, ide_gd_capacity(drive));
        return 0;
 }