Skip to content

Commit 3e2deba

Browse files
logostmartinkpetersen
authored andcommitted
scsi: target: core: New key must be used for moved PR
According to SPC4 5.12.8: e) Retain the reservation key specified in the SERVICE ACTION RESERVATION KEY field and associated information; But currently sa_res_key is only used for the not existing I_T nexus. Add a changing of the key for the existing I_T nexus the PR moved to. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Dmitry Bogdanov <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 49790e6 commit 3e2deba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/target/target_core_pr.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3440,8 +3440,6 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
34403440
* transport protocols where port names are not required;
34413441
* d) Register the reservation key specified in the SERVICE ACTION
34423442
* RESERVATION KEY field;
3443-
* e) Retain the reservation key specified in the SERVICE ACTION
3444-
* RESERVATION KEY field and associated information;
34453443
*
34463444
* Also, It is not an error for a REGISTER AND MOVE service action to
34473445
* register an I_T nexus that is already registered with the same
@@ -3463,6 +3461,12 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
34633461
dest_pr_reg = __core_scsi3_locate_pr_reg(dev, dest_node_acl,
34643462
iport_ptr);
34653463
new_reg = 1;
3464+
} else {
3465+
/*
3466+
* e) Retain the reservation key specified in the SERVICE ACTION
3467+
* RESERVATION KEY field and associated information;
3468+
*/
3469+
dest_pr_reg->pr_res_key = sa_res_key;
34663470
}
34673471
/*
34683472
* f) Release the persistent reservation for the persistent reservation

0 commit comments

Comments
 (0)