[PATCH] nvmet-fc: simplify and fix nvmet_fc_alloc_hostport
James Smart
jsmart2021 at gmail.com
Sat Mar 6 20:51:09 GMT 2021
On 3/6/2021 11:26 AM, James Smart wrote:
> On 3/4/2021 12:12 AM, amit.engel at dell.com wrote:
>> From: Amit Engel <amit.engel at dell.com>
>>
>> Alloc newhost only if no host has been found in host_list
>> Add a missing tgtport release reference
>>
>> Signed-off-by: Amit Engel <amit.engel at dell.com>
>
...
I looked at this again for the missing reference and as to why you may
have wanted to rework this.
I didn't see anything relative to tgtport reference. There is to be a
tgtport reference relative to the hostport struct, which is released
when the hostport is freed.
If the issue is many allocations that are then thrown away (the normal
case once created), then I recommend you rework your patch to release
the lock after not finding a match, doing the allocation, then relock
and re-search, if not found add, if found free the alloc. I'm ok with that.
-- james
More information about the Linux-nvme
mailing list