提交 3eb76c1c 编写于 作者: B Borislav Petkov 提交者: Bartlomiej Zolnierkiewicz

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: NBorislav Petkov <petkovbb@gmail.com>
[bart: backport to Linus' tree]
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 041b6237
......@@ -140,6 +140,12 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk,
rq->cmd_flags |= REQ_PREEMPT;
rq->buffer = (char *)pc;
rq->rq_disk = disk;
if (pc->req_xfer) {
rq->data = pc->buf;
rq->data_len = pc->req_xfer;
}
memcpy(rq->cmd, pc->c, 12);
if (drive->media == ide_tape)
rq->cmd[13] = REQ_IDETAPE_PC1;
......@@ -159,6 +165,12 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
rq->cmd_type = REQ_TYPE_SPECIAL;
rq->buffer = (char *)pc;
if (pc->req_xfer) {
rq->data = pc->buf;
rq->data_len = pc->req_xfer;
}
memcpy(rq->cmd, pc->c, 12);
if (drive->media == ide_tape)
rq->cmd[13] = REQ_IDETAPE_PC1;
......
......@@ -327,8 +327,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
return ide_stopped;
}
ide_init_sg_cmd(drive, rq);
ide_map_sg(drive, rq);
if (blk_fs_request(rq) || pc->req_xfer) {
ide_init_sg_cmd(drive, rq);
ide_map_sg(drive, rq);
}
pc->sg = hwif->sg_table;
pc->sg_cnt = hwif->sg_nents;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册