diff options
author | Borislav Petkov <petkovbb@gmail.com> | 2008-11-02 15:40:10 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-11-02 15:40:10 -0500 |
commit | 52ebb438e952c674e5a5c131292589db9bcf169b (patch) | |
tree | eba090be2781f18d7c6820f131d67c104b0cf548 /drivers/ide | |
parent | 7afa05350c42d8427f2d8f6112b64ab0812f3289 (diff) |
ide-gd: re-get capacity on revalidate
We need to re-get a removable media's capacity when revalidating the
disk so that its partitions get rescanned by the block layer.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: axboe@kernel.dk
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-gd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 7b6662854374..b8078b3231f7 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c | |||
@@ -281,7 +281,12 @@ static int ide_gd_media_changed(struct gendisk *disk) | |||
281 | static int ide_gd_revalidate_disk(struct gendisk *disk) | 281 | static int ide_gd_revalidate_disk(struct gendisk *disk) |
282 | { | 282 | { |
283 | struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); | 283 | struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); |
284 | set_capacity(disk, ide_gd_capacity(idkp->drive)); | 284 | ide_drive_t *drive = idkp->drive; |
285 | |||
286 | if (ide_gd_media_changed(disk)) | ||
287 | drive->disk_ops->get_capacity(drive); | ||
288 | |||
289 | set_capacity(disk, ide_gd_capacity(drive)); | ||
285 | return 0; | 290 | return 0; |
286 | } | 291 | } |
287 | 292 | ||