Skip to content

Commit

Permalink
ide-gd: re-get capacity on revalidate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Borislav Petkov authored and bzolnier committed Nov 2, 2008
1 parent 7afa053 commit 52ebb43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/ide/ide-gd.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 52ebb43

Please sign in to comment.