From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> This patch fixes a bug in core_scsi3_emulate_pro_register() with APTPL=0 where explictly changing the reservation key via REGISTER_* for an existing registration was missing the final core_scsi3_put_pr_reg() to drop pr_res_holders reference back to zero before returning. This bug would then manifest itself in __core_scsi3_free_registration() where we would end up waiting indefinately for t10_pr_registration->pr_res_holders to return to zero. [ 269.532906] SPC-3 PR [iSCSI] Service Action: REGISTER_AND_IGNORE_EXISTING_KEY Initiator Node: iqn.1994-05.com.redhat.cluster1:7f3715a3da22,i,0x00023d010000 [ 269.547412] SPC-3 PR [iSCSI] registration on Target Port: iqn.2010.ar.com.zumbi:disk0,0x0001 [ 269.555871] SPC-3 PR [iSCSI] for SINGLE TCM Subsystem iblock Object Target Port(s) [ 269.563978] SPC-3 PR [iSCSI] SA Res Key: 0x4b6579412d2d2d2d PRgeneration: 0x00000007 APTPL: 0 [ 269.573005] SPC-3 PR: Set APTPL Bit Deactivated for REGISTER [ 269.990649] SPC-3 PR [iSCSI] REGISTER_AND_IGNORE_EXISTING_KEY: Changed Reservation Key for iqn.1994-05.com.redhat.cluster1:7f3715a3da22 to: 0x4b6579422d2d2d2d PRgeneration: 0x00000008 [ 270.007747] SPC-3 PR: Set APTPL Bit Deactivated for REGISTER [ 270.453160] SPC-3 PR [iSCSI] waiting for pr_res_holders [ 270.460294] SPC-3 PR [iSCSI] waiting for pr_res_holders [ 270.465543] SPC-3 PR [iSCSI] waiting for pr_res_holders [ 270.471450] SPC-3 PR [iSCSI] waiting for pr_res_holders Reported-by: Gustavo Panizzo <gfaraway@xxxxxxxxx> Signed-off-by: Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx> --- drivers/target/target_core_pr.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index c36eaa6..307940d 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -2327,6 +2327,7 @@ static int core_scsi3_emulate_pro_register( if (!(aptpl)) { pr_tmpl->pr_aptpl_active = 0; core_scsi3_update_and_write_aptpl(dev, NULL, 0); + core_scsi3_put_pr_reg(pr_reg); printk("SPC-3 PR: Set APTPL Bit Deactivated" " for REGISTER\n"); return 0; -- 1.7.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html