target: Check -ENOMEM to signal QUEUE_FULL from fabric callbacks
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 26 Oct 2011 06:57:41 +0000 (23:57 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 27 Oct 2011 01:00:06 +0000 (01:00 +0000)
commitf147abb475ab47ce620cf3d18de5b3192c9fa7ed
tree2dddc11716663c387df52f102658c9812c62c54a
parent8cd79f24350826b81e16990d9e12bc878e67d385
target: Check -ENOMEM to signal QUEUE_FULL from fabric callbacks

This patch changes target core to also check for -ENOMEM from fabric callbacks
to signal QUEUE_FULL status, instead of just -EAGAIN in order to catch a
larger set of fabric failure cases that want to trigger QUEUE_FULL logic.
This includes the callbacks for ->write_pending(), ->queue_data_in() and
->queue_status().

It also makes transport_generic_write_pending() return zero upon QUEUE_FULL,
and removes two unnecessary -EAGAIN checks to catch write pending QUEUE_FULL
cases from transport_generic_new_cmd() failures in transport_handle_cdb_direct()
and transport_processing_thread():TRANSPORT_NEW_CMD_MAP state.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c