]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.14.8/target-allow-read_capacity-opcode-in-alua-standby-access-state.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.14.8 / target-allow-read_capacity-opcode-in-alua-standby-access-state.patch
CommitLineData
c372a4d7
GKH
1From e7810c2d2c37fa8e58dda74b00790dab60fe6fba Mon Sep 17 00:00:00 2001
2From: Nicholas Bellinger <nab@linux-iscsi.org>
3Date: Thu, 5 Jun 2014 23:37:00 -0700
4Subject: target: Allow READ_CAPACITY opcode in ALUA Standby access state
5
6From: Nicholas Bellinger <nab@linux-iscsi.org>
7
8commit e7810c2d2c37fa8e58dda74b00790dab60fe6fba upstream.
9
10This patch allows READ_CAPACITY + SAI_READ_CAPACITY_16 opcode
11processing to occur while the associated ALUA group is in Standby
12access state.
13
14This is required to avoid host side LUN probe failures during the
15initial scan if an ALUA group has already implicitly changed into
16Standby access state.
17
18This addresses a bug reported by Chris + Philip using dm-multipath
19+ ESX hosts configured with ALUA multipath.
20
21(Drop v3.15 specific set_ascq usage - nab)
22
23Reported-by: Chris Boot <crb@tiger-computing.co.uk>
24Reported-by: Philip Gaw <pgaw@darktech.org.uk>
25Cc: Chris Boot <crb@tiger-computing.co.uk>
26Cc: Philip Gaw <pgaw@darktech.org.uk>
27Cc: Hannes Reinecke <hare@suse.de>
28Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
29Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30---
31 drivers/target/target_core_alua.c | 9 +++++++++
32 1 file changed, 9 insertions(+)
33
34--- a/drivers/target/target_core_alua.c
35+++ b/drivers/target/target_core_alua.c
36@@ -564,7 +564,16 @@ static inline int core_alua_state_standb
37 case REPORT_LUNS:
38 case RECEIVE_DIAGNOSTIC:
39 case SEND_DIAGNOSTIC:
40+ case READ_CAPACITY:
41 return 0;
42+ case SERVICE_ACTION_IN:
43+ switch (cdb[1] & 0x1f) {
44+ case SAI_READ_CAPACITY_16:
45+ return 0;
46+ default:
47+ *alua_ascq = ASCQ_04H_ALUA_TG_PT_STANDBY;
48+ return 1;
49+ }
50 case MAINTENANCE_IN:
51 switch (cdb[1] & 0x1f) {
52 case MI_REPORT_TARGET_PGS: