Skip to content

Commit

Permalink
ide: clear ide_req()->special for non-passthrough requests
Browse files Browse the repository at this point in the history
The initial patch cleared this for all requests, which is wrong
since internal uses can't have this cleared as that's what they
are using to pass data. The fix moved the initialization to the
mq_ops->initialize_rq_fn(), but that's only a partial fix since
it only catches uses from blk_get_request(), not requests coming
from the file system.

Keep the non-fs initialization, and add the IDE entry clear
IFF RQF_DONTPREP isn't set and it's a passthrough request.

Fixes: d16a676 ("ide: don't clear special on ide_queue_rq() entry")
Fixes: 22ce0a7 ("ide: don't use req->special")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Nov 16, 2018
1 parent db29eb0 commit 9334ae5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,11 @@ blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx,
struct request *rq = bd->rq;
ide_startstop_t startstop;

if (!blk_rq_is_passthrough(rq) && !(rq->rq_flags & RQF_DONTPREP)) {
rq->rq_flags |= RQF_DONTPREP;
ide_req(rq)->special = NULL;
}

/* HLD do_request() callback might sleep, make sure it's okay */
might_sleep();

Expand Down

0 comments on commit 9334ae5

Please sign in to comment.