aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2015-04-14 14:52:22 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-04-16 01:46:30 -0400
commitbffb5128f91e820fd8804307a6431607c2c840a4 (patch)
tree1818f73d151f880d2e829acd8a6573a57001a1e8 /drivers/target
parentbfd9a53e0110442eeef670227907bdd14def94e1 (diff)
target: Ensure sess_prot_type is saved across session restart
The following incremental patch saves the current sess_prot_type into se_node_acl, and will always reset sess_prot_type if a previous saved value exists. So the PI setting for the fabric's session with backend devices not supporting PI is persistent across session restart. (Fix se_node_acl dereference for discovery sessions - DanCarpenter) Reviewed-by: Martin Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_transport.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 4edb183cf8df..14e324991c34 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -328,13 +328,6 @@ void __transport_register_session(
328 se_sess->se_tpg = se_tpg; 328 se_sess->se_tpg = se_tpg;
329 se_sess->fabric_sess_ptr = fabric_sess_ptr; 329 se_sess->fabric_sess_ptr = fabric_sess_ptr;
330 /* 330 /*
331 * Determine if fabric allows for T10-PI feature bits to be exposed
332 * to initiators for device backends with !dev->dev_attrib.pi_prot_type
333 */
334 if (tfo->tpg_check_prot_fabric_only)
335 se_sess->sess_prot_type = tfo->tpg_check_prot_fabric_only(se_tpg);
336
337 /*
338 * Used by struct se_node_acl's under ConfigFS to locate active se_session-t 331 * Used by struct se_node_acl's under ConfigFS to locate active se_session-t
339 * 332 *
340 * Only set for struct se_session's that will actually be moving I/O. 333 * Only set for struct se_session's that will actually be moving I/O.
@@ -342,6 +335,21 @@ void __transport_register_session(
342 */ 335 */
343 if (se_nacl) { 336 if (se_nacl) {
344 /* 337 /*
338 *
339 * Determine if fabric allows for T10-PI feature bits exposed to
340 * initiators for device backends with !dev->dev_attrib.pi_prot_type.
341 *
342 * If so, then always save prot_type on a per se_node_acl node
343 * basis and re-instate the previous sess_prot_type to avoid
344 * disabling PI from below any previously initiator side
345 * registered LUNs.
346 */
347 if (se_nacl->saved_prot_type)
348 se_sess->sess_prot_type = se_nacl->saved_prot_type;
349 else if (tfo->tpg_check_prot_fabric_only)
350 se_sess->sess_prot_type = se_nacl->saved_prot_type =
351 tfo->tpg_check_prot_fabric_only(se_tpg);
352 /*
345 * If the fabric module supports an ISID based TransportID, 353 * If the fabric module supports an ISID based TransportID,
346 * save this value in binary from the fabric I_T Nexus now. 354 * save this value in binary from the fabric I_T Nexus now.
347 */ 355 */