Hello, James.
Now that new ordered implementation is in the mainline, we can properly
use ordered-tag during barrier sequence. As noted in the barrier doc,
the problem with the current SCSI midlayer is that scsi_request_fn() is
not atomic w.r.t. q->queuelock, so even if ordered-tag requests leave
request queue in the correct order, they can be reordered while they are
being issued by SCSI midlayer.
There can be two solutions to this problem.
1. Rewrite scsi_request_fn() and scsi_dispatch_cmd() such that
q->queuelock is not released during command issue. This implies
grabbing shost->host_lock while holding q->queuelock.
2. Don't allow concurrent command issuing by marking SCSI device during
command issuing (e.g. sdev->issue_in_progress)
I prefer #1 as it's more straight-forward. To implement #1,
scsi_request_fn() should be reorganized quite a bit, but, if you
remember, the scsi_reqfn reimplementation patch I wrote quite a while
ago suites this pretty well. What do you think?
--
tejun
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html