aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-15 16:16:10 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-15 16:16:10 -0400
commit2c7eaa43c3bb7b3b9fe2051d17f308c1f0728c78 (patch)
tree1b359598ea212bf7036bcc018186e0a8f20ac5f4 /drivers/ide
parenta9c415090710a108edcd81b3392b90396f190a9a (diff)
ide: BUG() on unknown requests
Unsupported requests should be never handed down to device drivers and the best thing we can do upon discovering such request inside driver's ->do_request method is to just BUG(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c8
-rw-r--r--drivers/ide/ide-disk.c9
-rw-r--r--drivers/ide/ide-floppy.c6
-rw-r--r--drivers/ide/ide-tape.c10
4 files changed, 6 insertions, 27 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index dcd72445b0cd..0b7645b13df1 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -785,12 +785,8 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
785 /* right now this can only be a reset... */ 785 /* right now this can only be a reset... */
786 uptodate = 1; 786 uptodate = 1;
787 goto out_end; 787 goto out_end;
788 } else { 788 } else
789 blk_dump_rq_flags(rq, DRV_NAME " bad flags"); 789 BUG();
790 if (rq->errors == 0)
791 rq->errors = -EIO;
792 goto out_end;
793 }
794 790
795 /* prepare sense request for this command */ 791 /* prepare sense request for this command */
796 ide_prep_sense(drive, rq); 792 ide_prep_sense(drive, rq);
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 6a1de2169709..695181120cdb 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -184,14 +184,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
184 ide_hwif_t *hwif = drive->hwif; 184 ide_hwif_t *hwif = drive->hwif;
185 185
186 BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED); 186 BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED);
187 187 BUG_ON(!blk_fs_request(rq));
188 if (!blk_fs_request(rq)) {
189 blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command");
190 if (rq->errors == 0)
191 rq->errors = -EIO;
192 ide_complete_rq(drive, -EIO, ide_rq_bytes(rq));
193 return ide_stopped;
194 }
195 188
196 ledtrig_ide_activity(); 189 ledtrig_ide_activity();
197 190
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 800c83a9db83..8b3f204f7d73 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -269,10 +269,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
269 } else if (blk_pc_request(rq)) { 269 } else if (blk_pc_request(rq)) {
270 pc = &floppy->queued_pc; 270 pc = &floppy->queued_pc;
271 idefloppy_blockpc_cmd(floppy, pc, rq); 271 idefloppy_blockpc_cmd(floppy, pc, rq);
272 } else { 272 } else
273 blk_dump_rq_flags(rq, PFX "unsupported command in queue"); 273 BUG();
274 goto out_end;
275 }
276 274
277 ide_prep_sense(drive, rq); 275 ide_prep_sense(drive, rq);
278 276
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3a3f10f3f8fe..013dc595fab6 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -586,15 +586,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
586 debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %u\n" 586 debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %u\n"
587 (unsigned long long)blk_rq_pos(rq), blk_rq_sectors(rq)); 587 (unsigned long long)blk_rq_pos(rq), blk_rq_sectors(rq));
588 588
589 if (!(blk_special_request(rq) || blk_sense_request(rq))) { 589 BUG_ON(!(blk_special_request(rq) || blk_sense_request(rq)));
590 /* We do not support buffer cache originated requests. */
591 printk(KERN_NOTICE "ide-tape: %s: Unsupported request in "
592 "request queue (%d)\n", drive->name, rq->cmd_type);
593 if (blk_fs_request(rq) == 0 && rq->errors == 0)
594 rq->errors = -EIO;
595 ide_complete_rq(drive, -EIO, ide_rq_bytes(rq));
596 return ide_stopped;
597 }
598 590
599 /* Retry a failed packet command */ 591 /* Retry a failed packet command */
600 if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) { 592 if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) {