Comment 13 for bug 1689365

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2017-07-31 11:57 EDT-------
The reason target: Fix unknown fabric callback queue-full errors is required is because if ibmvscsi driver returns a non -EAGAIN or -ENOMEM error back to target-core then outgoing responses are leaked. This case is seen in ibmvscsis_write_pending, we added code to return 0 to address cases where if client failed or response queue is down to just return success to LIO, since they can't do anything about it. (This is part of ibmvscsis: Do not send aborted task response patch) But for cases where we attempted to transfer the data and it failed and we return a -EIO, target core would leak. Thus we need the target-core fix to address the 2nd part of that issue.

static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
{
struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd,
se_cmd);
struct scsi_info *vscsi = cmd->adapter;
struct iu_entry *iue = cmd->iue;
int rc;

/*
* If CLIENT_FAILED OR RESPONSE_Q_DOWN, then just return success
* since LIO can't do anything about it, and we dont want to
* attempt an srp_transfer_data.
*/
if ((vscsi->flags & (CLIENT_FAILED | RESPONSE_Q_DOWN))) {
pr_err("write_pending failed since: %d\n", vscsi->flags);
return 0;
}

rc = srp_transfer_data(cmd, &vio_iu(iue)->srp.cmd, ibmvscsis_rdma,
1, 1);
if (rc) {
pr_err("srp_transfer_data() failed: %d\n", rc);
return -EIO;
}
/*
* We now tell TCM to add this WRITE CDB directly into the TCM storage
* object execution queue.
*/
target_execute_cmd(se_cmd);
return 0;
}