]> git.baikalelectronics.ru Git - kernel.git/commit
target: Return error to initiator if SET TARGET PORT GROUPS emulation fails
authorRoland Dreier <roland@purestorage.com>
Tue, 5 Jun 2012 06:24:51 +0000 (23:24 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 13 Jun 2012 03:12:25 +0000 (20:12 -0700)
commit1667ae2a34ad47f368679476a1c52e570ff4b8c5
tree2ae398d642adc5437e01daa0751875ca7997b58e
parent44d72a837fa497a1fda7201898dcac7d6d2a29a6
target: Return error to initiator if SET TARGET PORT GROUPS emulation fails

The error paths in target_emulate_set_target_port_groups() are all
essentially "rc = -EINVAL; goto out;" but the code at "out:" ignores
rc and always returns success.  This means that even if eg explicit
ALUA is turned off, the initiator will always see a good SCSI status
for SET TARGET PORT GROUPS.

Fix this by returning rc as is intended.  It appears this bug was
added by the following patch:

commit 98537930db133e8b4fc88b7edaab07a321deacf2
Author: Andy Grover <agrover@redhat.com>
Date:   Wed Jul 20 19:13:28 2011 +0000

    target: Make all control CDBs scatter-gather

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_alua.c