diff options
author | Borislav Petkov <petkovbb@gmail.com> | 2009-03-13 16:16:12 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-13 16:16:12 -0400 |
commit | 3eb76c1ccde496c3c0bfda23d1c803e40b762ce6 (patch) | |
tree | 2a1524a72a5005c512d4f45696d7cde964f7f457 | |
parent | 041b62374c7fedc11a8a1eeda2868612d3d1436c (diff) |
ide-floppy: do not map dataless cmds to an sg
since it fails the virt_to_page() translation check with DEBUG_VIRTUAL
enabled.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
[bart: backport to Linus' tree]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-atapi.c | 12 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 6 |
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index e96c01260598..e9d042dba0e0 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -140,6 +140,12 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk, | |||
140 | rq->cmd_flags |= REQ_PREEMPT; | 140 | rq->cmd_flags |= REQ_PREEMPT; |
141 | rq->buffer = (char *)pc; | 141 | rq->buffer = (char *)pc; |
142 | rq->rq_disk = disk; | 142 | rq->rq_disk = disk; |
143 | |||
144 | if (pc->req_xfer) { | ||
145 | rq->data = pc->buf; | ||
146 | rq->data_len = pc->req_xfer; | ||
147 | } | ||
148 | |||
143 | memcpy(rq->cmd, pc->c, 12); | 149 | memcpy(rq->cmd, pc->c, 12); |
144 | if (drive->media == ide_tape) | 150 | if (drive->media == ide_tape) |
145 | rq->cmd[13] = REQ_IDETAPE_PC1; | 151 | rq->cmd[13] = REQ_IDETAPE_PC1; |
@@ -159,6 +165,12 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, | |||
159 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 165 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
160 | rq->cmd_type = REQ_TYPE_SPECIAL; | 166 | rq->cmd_type = REQ_TYPE_SPECIAL; |
161 | rq->buffer = (char *)pc; | 167 | rq->buffer = (char *)pc; |
168 | |||
169 | if (pc->req_xfer) { | ||
170 | rq->data = pc->buf; | ||
171 | rq->data_len = pc->req_xfer; | ||
172 | } | ||
173 | |||
162 | memcpy(rq->cmd, pc->c, 12); | 174 | memcpy(rq->cmd, pc->c, 12); |
163 | if (drive->media == ide_tape) | 175 | if (drive->media == ide_tape) |
164 | rq->cmd[13] = REQ_IDETAPE_PC1; | 176 | rq->cmd[13] = REQ_IDETAPE_PC1; |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 3eab1c6c9b31..317ec62c33d4 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -327,8 +327,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, | |||
327 | return ide_stopped; | 327 | return ide_stopped; |
328 | } | 328 | } |
329 | 329 | ||
330 | ide_init_sg_cmd(drive, rq); | 330 | if (blk_fs_request(rq) || pc->req_xfer) { |
331 | ide_map_sg(drive, rq); | 331 | ide_init_sg_cmd(drive, rq); |
332 | ide_map_sg(drive, rq); | ||
333 | } | ||
332 | 334 | ||
333 | pc->sg = hwif->sg_table; | 335 | pc->sg = hwif->sg_table; |
334 | pc->sg_cnt = hwif->sg_nents; | 336 | pc->sg_cnt = hwif->sg_nents; |