On 05/01/2015 10:50 AM, Christoph Hellwig wrote:
This looks good to me,
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Thanks!
But while reviewing this I noticed another oddity:
tcmu totally ignores the non-cmd arguments to tcmu_execute_rw.
These arguments exist to support commands like COMPARE AND WRITE
that first do a read and then a write pass, which scb_parse_cdb
will hapilly accept, but which will be broken with tcmu.
[CCing Ilias too]
Hey, at least it's just a bug and not another API issue.
So, TCMU just wants its tcmu_execute_rw called just once, even for BIDI
commands (e.g. COMPARE_AND_WRITE and XDWRITEREAD*)
Setting cmd->transport_complete_callback is happening in sbc_parse_cdb,
some options:
1) in tcmu_parse_cdb, don't call sbc_parse_cdb for bidi opcodes, do what
it would have done except don't set cmd->transport_complete_callback and
set cmd->execute_cmd to sbc_execute_rw
2) in tcmu_parse_cdb, call sbc_parse_cdb for all opcodes but then NULL
the callback ptr and fix the execute_cmd pointer for BIDI opcodes,
either explicitly by opcodes or based on SCF_BIDI and
SCF_COMPARE_AND_WRITE flags to identify cmds to fix
3) wait until in tcmu_execute_rw, and before completing the cmd for the
first time, set cmd->transport_complete_callback to NULL and
up(dev->caw_sem) ourselves
4) Use two-pass for tcmu, change the opcode that userspace sees in both
passes to reads and writes
5) some other way?
I'd lean towards #2. Thoughts?
Regards -- Andy
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html