Hi Andy, If I understand correctly, COMPARE_AND_WRITE is not a BIDI command. I cannot find anywhere in the SBC SCSI documentation that COMPARE_AND_WRITE uses the DATA_IN buffer. The fact that sbc_compare_and_write() uses the 't_bidi_data_sg' scatterlist seems to be a bug in the target/sbc code. I tried to perform a COMPARE_AND_WRITE command (using the sg_compare_and_write utility) with fileio as backstore and the command timed-out. It seems to me that sbc_compare_and_write() uses the 't_bidi_data_sg' scatterlist for read but 't_bidi_data_sg' is empty. Nick, can you take a look at this? So, I suggest we drop this patch. Cheers, Ilias On Mon, May 04, 2015 at 12:40PM, Andy Grover wrote: > COMPARE_AND_WRITE gets its own flags, but it's also a BIDI command. Set > the SCF_BIDI flag for it as well. This will let BIDI-handling code just > check SCF_BIDI, like in generic_new_cmd, and also apply BIDI code paths > that only check SCF_BIDI, like in TCM User, to CAW. > > Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> > --- > drivers/target/target_core_sbc.c | 2 +- > drivers/target/target_core_transport.c | 3 +-- > 2 files changed, 2 insertions(+), 3 deletions(-)
Attachment:
signature.asc
Description: Digital signature