From b3cb81efd318b48e9cb923587ccafe0d5e05d42b Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 14 Feb 2012 15:30:31 -0800 Subject: [PATCH] --- yaml --- r: 292839 b: refs/heads/master c: 6cf3fa6918baab0c447f1206f1cef9166ad04864 h: refs/heads/master i: 292837: 6fa595e6de1e94038ccf12ab59966580a161a40c 292835: 59de95b2e144cceb89fb4d580ac0fdbc90a8f6d0 292831: 91412c201b57f34cb2e5ede753f5f90ddf826d2b v: v3 --- [refs] | 2 +- trunk/drivers/target/loopback/tcm_loop.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e90e22982476..b0bdad05c7a5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 015487b89f27d91d95a056cdc3c85e6c729bff12 +refs/heads/master: 6cf3fa6918baab0c447f1206f1cef9166ad04864 diff --git a/trunk/drivers/target/loopback/tcm_loop.c b/trunk/drivers/target/loopback/tcm_loop.c index 88fb3d1b0ad5..041673e9d2db 100644 --- a/trunk/drivers/target/loopback/tcm_loop.c +++ b/trunk/drivers/target/loopback/tcm_loop.c @@ -829,6 +829,9 @@ static int tcm_loop_queue_data_in(struct se_cmd *se_cmd) sc->result = SAM_STAT_GOOD; set_host_byte(sc, DID_OK); + if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || + (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT)) + scsi_set_resid(sc, se_cmd->residual_count); sc->scsi_done(sc); return 0; } @@ -854,6 +857,9 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd) sc->result = se_cmd->scsi_status; set_host_byte(sc, DID_OK); + if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) || + (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT)) + scsi_set_resid(sc, se_cmd->residual_count); sc->scsi_done(sc); return 0; }