Set IDE_DFLAG_MEDIA_CHANGED in ide_gd_open() to signalize
ide_gd_media_changed() that that media has changed (instead
of relying on IDE_DFLAG_REMOVABLE).
There should be no functional changes caused by this patch.
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* and the door_lock is irrelevant at this point.
*/
ide_disk_set_doorlock(drive, 1);
* and the door_lock is irrelevant at this point.
*/
ide_disk_set_doorlock(drive, 1);
+ drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
check_disk_change(inode->i_bdev);
}
return 0;
check_disk_change(inode->i_bdev);
}
return 0;
{
struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
ide_drive_t *drive = idkp->drive;
{
struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
ide_drive_t *drive = idkp->drive;
/* do not scan partitions twice if this is a removable device */
if (drive->dev_flags & IDE_DFLAG_ATTACH) {
/* do not scan partitions twice if this is a removable device */
if (drive->dev_flags & IDE_DFLAG_ATTACH) {
- /* if removable, always assume it was changed */
- return !!(drive->dev_flags & IDE_DFLAG_REMOVABLE);
+ ret = !!(drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED);
+ drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
+
+ return ret;
}
static int ide_gd_revalidate_disk(struct gendisk *disk)
}
static int ide_gd_revalidate_disk(struct gendisk *disk)