• Roland Dreier's avatar
    target: Return error to initiator if SET TARGET PORT GROUPS emulation fails · 59e4f541
    Roland Dreier authored
    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 05d1c7c0
    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: default avatarRoland Dreier <roland@purestorage.com>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    59e4f541
target_core_alua.c 57.1 KB