]>
Commit | Line | Data |
---|---|---|
c372a4d7 GKH |
1 | From e7810c2d2c37fa8e58dda74b00790dab60fe6fba Mon Sep 17 00:00:00 2001 |
2 | From: Nicholas Bellinger <nab@linux-iscsi.org> | |
3 | Date: Thu, 5 Jun 2014 23:37:00 -0700 | |
4 | Subject: target: Allow READ_CAPACITY opcode in ALUA Standby access state | |
5 | ||
6 | From: Nicholas Bellinger <nab@linux-iscsi.org> | |
7 | ||
8 | commit e7810c2d2c37fa8e58dda74b00790dab60fe6fba upstream. | |
9 | ||
10 | This patch allows READ_CAPACITY + SAI_READ_CAPACITY_16 opcode | |
11 | processing to occur while the associated ALUA group is in Standby | |
12 | access state. | |
13 | ||
14 | This is required to avoid host side LUN probe failures during the | |
15 | initial scan if an ALUA group has already implicitly changed into | |
16 | Standby access state. | |
17 | ||
18 | This 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 | ||
23 | Reported-by: Chris Boot <crb@tiger-computing.co.uk> | |
24 | Reported-by: Philip Gaw <pgaw@darktech.org.uk> | |
25 | Cc: Chris Boot <crb@tiger-computing.co.uk> | |
26 | Cc: Philip Gaw <pgaw@darktech.org.uk> | |
27 | Cc: Hannes Reinecke <hare@suse.de> | |
28 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | |
29 | Signed-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: |