Commit b4a427fe authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] fix rq->flags use in ide-tape.c

Noticed by Stuart_Hayes@Dell.com:

I've noticed that, in the 2.6 (test 9) kernel, the "cmd" field (of type int)
in struct request has been removed, and it looks like all of the code in
ide-tape has just had a find & replace run on it to replace any instance of
rq.cmd or rq->cmd with rq.flags or rq->flags.

The values being put into "cmd" in 2.4 (now "flags", in 2.6) by ide-tape are
8-bit numbers, like 90, 91, etc... and the actual flags that are being used
in "flags" cover the low 23 bits.  So, not only do the flags get wiped out
when, say, ide-tape assigns, say, 90 to "flags", but also the 90 gets wiped
out when one of the flags is modified.

I noticed this, because ide-tape checks this value, and spews error codes
when it isn't correct--continuously--as soon as you load the module, because
ide-tape is calling ide_do_drive_cmd with an action of ide_preempt, which
causes ide_do_drive_cmd to set the REQ_PREEMPT flag, so "flags" isn't the
same when it gets back to idetape_do_request.
parent 0d308a79
...@@ -780,6 +780,11 @@ static char *rq_flags[] = { ...@@ -780,6 +780,11 @@ static char *rq_flags[] = {
"REQ_PM_SUSPEND", "REQ_PM_SUSPEND",
"REQ_PM_RESUME", "REQ_PM_RESUME",
"REQ_PM_SHUTDOWN", "REQ_PM_SHUTDOWN",
"REQ_IDETAPE_PC1",
"REQ_IDETAPE_PC2",
"REQ_IDETAPE_READ",
"REQ_IDETAPE_WRITE",
"REQ_IDETAPE_READ_BUFFER",
}; };
void blk_dump_rq_flags(struct request *rq, char *msg) void blk_dump_rq_flags(struct request *rq, char *msg)
......
This diff is collapsed.
...@@ -193,6 +193,11 @@ enum rq_flag_bits { ...@@ -193,6 +193,11 @@ enum rq_flag_bits {
__REQ_PM_SUSPEND, /* suspend request */ __REQ_PM_SUSPEND, /* suspend request */
__REQ_PM_RESUME, /* resume request */ __REQ_PM_RESUME, /* resume request */
__REQ_PM_SHUTDOWN, /* shutdown request */ __REQ_PM_SHUTDOWN, /* shutdown request */
__REQ_IDETAPE_PC1, /* packet command (first stage) */
__REQ_IDETAPE_PC2, /* packet command (second stage) */
__REQ_IDETAPE_READ,
__REQ_IDETAPE_WRITE,
__REQ_IDETAPE_READ_BUFFER,
__REQ_NR_BITS, /* stops here */ __REQ_NR_BITS, /* stops here */
}; };
...@@ -218,6 +223,11 @@ enum rq_flag_bits { ...@@ -218,6 +223,11 @@ enum rq_flag_bits {
#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND) #define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
#define REQ_PM_RESUME (1 << __REQ_PM_RESUME) #define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
#define REQ_IDETAPE_PC1 (1 << __REQ_IDETAPE_PC1)
#define REQ_IDETAPE_PC2 (1 << __REQ_IDETAPE_PC2)
#define REQ_IDETAPE_READ (1 << __REQ_IDETAPE_READ)
#define REQ_IDETAPE_WRITE (1 << __REQ_IDETAPE_WRITE)
#define REQ_IDETAPE_READ_BUFFER (1 << __REQ_IDETAPE_READ_BUFFER)
/* /*
* State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment