]> git.baikalelectronics.ru Git - kernel.git/commit
iscsi-target: Return error if unable to add network portal
authorVarun Prakash <varun@chelsio.com>
Sun, 11 Dec 2016 16:35:56 +0000 (22:05 +0530)
committerBart Van Assche <bart.vanassche@sandisk.com>
Fri, 16 Dec 2016 10:16:15 +0000 (11:16 +0100)
commite376761b20509f70a4e868ae40b0268746a5caaf
treec3b9d9dd2438fd5792a18da2652ed32e5889585c
parent148f9fb2041546e0b7f9deb13d3b4daeeaa47de2
iscsi-target: Return error if unable to add network portal

If iscsit_tpg_add_network_portal() fails then
return error code instead of 0 to user space.

If iscsi-target returns 0 then user space keeps
on retrying same command infinitely, targetcli or
echo hangs till command completes with non zero
return value. In some cases it is possible that
add network portal command never completes with
success even after retrying multiple times,
for example - cxgbit_setup_np() always returns
-EINVAL if portal IP does not belong to Chelsio
adapter interface.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
[ bvanassche: Added "Fixes:" and "Cc: stable" tags ]
Fixes: commit b95356008007 ("iscsi-target: Make iscsi_tpg_np driver show/store use generic code")
Cc: <stable@vger.kernel.org>
drivers/target/iscsi/iscsi_target_configfs.c