mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
nvmet-fc: update tgtport ref per assoc
We need to take for each unique association a reference. nvmet_fc_alloc_hostport for each newly created association. Signed-off-by: Daniel Wagner <wagi@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
88517565b5
commit
1a90956573
|
|
@ -1127,6 +1127,7 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
|
|||
goto out_ida;
|
||||
|
||||
assoc->tgtport = tgtport;
|
||||
nvmet_fc_tgtport_get(tgtport);
|
||||
assoc->a_id = idx;
|
||||
INIT_LIST_HEAD(&assoc->a_list);
|
||||
kref_init(&assoc->ref);
|
||||
|
|
@ -1228,6 +1229,8 @@ nvmet_fc_delete_target_assoc(struct nvmet_fc_tgt_assoc *assoc)
|
|||
dev_info(tgtport->dev,
|
||||
"{%d:%d} Association deleted\n",
|
||||
tgtport->fc_target_port.port_num, assoc->a_id);
|
||||
|
||||
nvmet_fc_tgtport_put(tgtport);
|
||||
}
|
||||
|
||||
static struct nvmet_fc_tgt_assoc *
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user