Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274334
b: refs/heads/master
c: f147abb
h: refs/heads/master
v: v3
  • Loading branch information
Nicholas Bellinger committed Oct 27, 2011
1 parent 8eef92a commit 61b393e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8cd79f24350826b81e16990d9e12bc878e67d385
refs/heads/master: f147abb475ab47ce620cf3d18de5b3192c9fa7ed
31 changes: 15 additions & 16 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ void transport_remove_task_from_execute_queue(
}

/*
* Handle QUEUE_FULL / -EAGAIN status
* Handle QUEUE_FULL / -EAGAIN and -ENOMEM status
*/

static void target_qf_do_work(struct work_struct *work)
Expand Down Expand Up @@ -1645,9 +1645,7 @@ int transport_handle_cdb_direct(
* and call transport_generic_request_failure() if necessary..
*/
ret = transport_generic_new_cmd(cmd);
if (ret == -EAGAIN)
return 0;
else if (ret < 0) {
if (ret < 0) {
cmd->transport_error_status = ret;
transport_generic_request_failure(cmd, 0,
(cmd->data_direction != DMA_TO_DEVICE));
Expand Down Expand Up @@ -1886,7 +1884,7 @@ static void transport_generic_request_failure(
ASCQ_2CH_PREVIOUS_RESERVATION_CONFLICT_STATUS);

ret = cmd->se_tfo->queue_status(cmd);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;
goto check_stop;
case PYX_TRANSPORT_USE_SENSE_REASON:
Expand All @@ -1913,7 +1911,7 @@ static void transport_generic_request_failure(
else {
ret = transport_send_check_condition_and_sense(cmd,
cmd->scsi_sense_reason, 0);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;
}

Expand Down Expand Up @@ -3308,7 +3306,7 @@ static void target_complete_ok_work(struct work_struct *work)
if (cmd->scsi_status) {
ret = transport_send_check_condition_and_sense(
cmd, reason, 1);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;

transport_lun_remove_cmd(cmd);
Expand All @@ -3333,7 +3331,7 @@ static void target_complete_ok_work(struct work_struct *work)
spin_unlock(&cmd->se_lun->lun_sep_lock);

ret = cmd->se_tfo->queue_data_in(cmd);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;
break;
case DMA_TO_DEVICE:
Expand All @@ -3354,14 +3352,14 @@ static void target_complete_ok_work(struct work_struct *work)
}
spin_unlock(&cmd->se_lun->lun_sep_lock);
ret = cmd->se_tfo->queue_data_in(cmd);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;
break;
}
/* Fall through for DMA_TO_DEVICE */
case DMA_NONE:
ret = cmd->se_tfo->queue_status(cmd);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;
break;
default:
Expand Down Expand Up @@ -3890,7 +3888,10 @@ EXPORT_SYMBOL(transport_generic_process_write);

static void transport_write_pending_qf(struct se_cmd *cmd)
{
if (cmd->se_tfo->write_pending(cmd) == -EAGAIN) {
int ret;

ret = cmd->se_tfo->write_pending(cmd);
if (ret == -EAGAIN || ret == -ENOMEM) {
pr_debug("Handling write_pending QUEUE__FULL: se_cmd: %p\n",
cmd);
transport_handle_queue_full(cmd, cmd->se_dev);
Expand Down Expand Up @@ -3920,7 +3921,7 @@ static int transport_generic_write_pending(struct se_cmd *cmd)
* frontend know that WRITE buffers are ready.
*/
ret = cmd->se_tfo->write_pending(cmd);
if (ret == -EAGAIN)
if (ret == -EAGAIN || ret == -ENOMEM)
goto queue_full;
else if (ret < 0)
return ret;
Expand All @@ -3931,7 +3932,7 @@ static int transport_generic_write_pending(struct se_cmd *cmd)
pr_debug("Handling write_pending QUEUE__FULL: se_cmd: %p\n", cmd);
cmd->t_state = TRANSPORT_COMPLETE_QF_WP;
transport_handle_queue_full(cmd, cmd->se_dev);
return ret;
return 0;
}

/**
Expand Down Expand Up @@ -4583,9 +4584,7 @@ static int transport_processing_thread(void *param)
break;
}
ret = transport_generic_new_cmd(cmd);
if (ret == -EAGAIN)
break;
else if (ret < 0) {
if (ret < 0) {
cmd->transport_error_status = ret;
transport_generic_request_failure(cmd,
0, (cmd->data_direction !=
Expand Down

0 comments on commit 61b393e

Please sign in to comment.