Commit eced4ec1 authored by Nicholas Bellinger's avatar Nicholas Bellinger Committed by Greg Kroah-Hartman

target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs

commit 30f359a6 upstream.

This patch fixes a bug where a handful of informational / control CDBs
that should be allowed during ALUA access state Standby/Offline/Transition
where incorrectly returning CHECK_CONDITION + ASCQ_04H_ALUA_TG_PT_*.

This includes INQUIRY + REPORT_LUNS, which would end up preventing LUN
registration when LUN scanning occured during these ALUA access states.
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0b4cef3
...@@ -392,6 +392,7 @@ static inline int core_alua_state_standby( ...@@ -392,6 +392,7 @@ static inline int core_alua_state_standby(
case REPORT_LUNS: case REPORT_LUNS:
case RECEIVE_DIAGNOSTIC: case RECEIVE_DIAGNOSTIC:
case SEND_DIAGNOSTIC: case SEND_DIAGNOSTIC:
return 0;
case MAINTENANCE_IN: case MAINTENANCE_IN:
switch (cdb[1]) { switch (cdb[1]) {
case MI_REPORT_TARGET_PGS: case MI_REPORT_TARGET_PGS:
...@@ -434,6 +435,7 @@ static inline int core_alua_state_unavailable( ...@@ -434,6 +435,7 @@ static inline int core_alua_state_unavailable(
switch (cdb[0]) { switch (cdb[0]) {
case INQUIRY: case INQUIRY:
case REPORT_LUNS: case REPORT_LUNS:
return 0;
case MAINTENANCE_IN: case MAINTENANCE_IN:
switch (cdb[1]) { switch (cdb[1]) {
case MI_REPORT_TARGET_PGS: case MI_REPORT_TARGET_PGS:
...@@ -474,6 +476,7 @@ static inline int core_alua_state_transition( ...@@ -474,6 +476,7 @@ static inline int core_alua_state_transition(
switch (cdb[0]) { switch (cdb[0]) {
case INQUIRY: case INQUIRY:
case REPORT_LUNS: case REPORT_LUNS:
return 0;
case MAINTENANCE_IN: case MAINTENANCE_IN:
switch (cdb[1]) { switch (cdb[1]) {
case MI_REPORT_TARGET_PGS: case MI_REPORT_TARGET_PGS:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment