From ca8789498014fa3d60ffffce8607aae56703c8b4 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 22 Jan 2015 05:03:17 +0000 Subject: [PATCH] [PATCH] scst_local: Fix bidirectional command support scsi_setup_cmnd() sets sc_data_direction to DMA_TO_DEVICE for bidirectional commands. Hence test SCpnt->request->next_rq instead of sc_data_direction to figure out whether or not a command is bidirectional. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5984 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index ed3a5b375..06f049ec5 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1069,7 +1069,8 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt, #endif dir = SCST_DATA_NONE; - switch (SCpnt->sc_data_direction) { + switch (SCpnt->request->next_rq ? DMA_BIDIRECTIONAL : + SCpnt->sc_data_direction) { case DMA_TO_DEVICE: dir = SCST_DATA_WRITE; scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(SCpnt));