]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix possible TFO->write_pending() sense_reason_t silent WRITE corruption
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 6 Nov 2012 23:43:53 +0000 (15:43 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 8 Nov 2012 04:10:56 +0000 (20:10 -0800)
commitfcb52af0ff610210c8aa33577c6979c7b70f7704
tree9bd450b152ed11dee3d617a5345da78c543f23dc
parent7cce0922401036892988fc55663324f2681175d3
target: Fix possible TFO->write_pending() sense_reason_t silent WRITE corruption

This patch fixes a possible case in transport_generic_new_cmd() where a
failure from TFO->write_pending() from a fabric module return something
other than -EAGAIN or -ENOMEM would cause a failed WRITE to silently
succeed.

Go ahead and return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE for this
special case instead of only just making noise with WARN_ON().

(v2: Fix incorrect exception return for all cases)

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