]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmet-fc: take tgtport reference only once
authorDaniel Wagner <wagi@kernel.org>
Tue, 8 Apr 2025 15:29:09 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:47:06 +0000 (07:47 +0200)
commitb7f235cb883e4ac7691b32c7e6c50f40c3a09aaf
tree4977cae40db10e946492385765d4f980cbe9fcf9
parent2184c4297175ca56858e8cfdb9e9690ebcf709d6
nvmet-fc: take tgtport reference only once

[ Upstream commit b0b26ad0e1943de25ce82a7e5af3574f31b1cf99 ]

The reference counting code can be simplified. Instead taking a tgtport
refrerence at the beginning of nvmet_fc_alloc_hostport and put it back
if not a new hostport object is allocated, only take it when a new
hostport object is allocated.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/fc.c