diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 5b3bfc78dcdd..4d0c661e78a5 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -562,7 +562,6 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device | |||
562 | unsigned int cmd, unsigned long arg) | 562 | unsigned int cmd, unsigned long arg) |
563 | { | 563 | { |
564 | unsigned long flags; | 564 | unsigned long flags; |
565 | ide_driver_t *drv; | ||
566 | int err = 0, (*getfunc)(ide_drive_t *), (*setfunc)(ide_drive_t *, int); | 565 | int err = 0, (*getfunc)(ide_drive_t *), (*setfunc)(ide_drive_t *, int); |
567 | 566 | ||
568 | switch (cmd) { | 567 | switch (cmd) { |
@@ -612,12 +611,12 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device | |||
612 | if (!capable(CAP_SYS_ADMIN)) return -EACCES; | 611 | if (!capable(CAP_SYS_ADMIN)) return -EACCES; |
613 | if (arg != (arg & ((1 << IDE_NICE_DSC_OVERLAP) | (1 << IDE_NICE_1)))) | 612 | if (arg != (arg & ((1 << IDE_NICE_DSC_OVERLAP) | (1 << IDE_NICE_1)))) |
614 | return -EPERM; | 613 | return -EPERM; |
615 | drive->dsc_overlap = (arg >> IDE_NICE_DSC_OVERLAP) & 1; | 614 | if (((arg >> IDE_NICE_DSC_OVERLAP) & 1) && |
616 | drv = *(ide_driver_t **)bdev->bd_disk->private_data; | 615 | (drive->media == ide_disk || |
617 | if (drive->dsc_overlap && !drv->supports_dsc_overlap) { | 616 | drive->media == ide_floppy || |
618 | drive->dsc_overlap = 0; | 617 | drive->scsi)) |
619 | return -EPERM; | 618 | return -EPERM; |
620 | } | 619 | drive->dsc_overlap = (arg >> IDE_NICE_DSC_OVERLAP) & 1; |
621 | drive->nice1 = (arg >> IDE_NICE_1) & 1; | 620 | drive->nice1 = (arg >> IDE_NICE_1) & 1; |
622 | return 0; | 621 | return 0; |
623 | case HDIO_DRIVE_RESET: | 622 | case HDIO_DRIVE_RESET: |