lkml.org 
[lkml]   [2016]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/4] target: Obtain se_node_acl->acl_kref during get_initiator_node_acl
From
Date
On 01/08/2016 09:14 AM, Christoph Hellwig wrote:
>> mutex_lock(&tpg->acl_node_mutex);
>> acl = __core_tpg_get_initiator_node_acl(tpg, initiatorname);
>> + /*
>> + * Obtain the acl_kref now, which will be dropped upon the
>> + * release of se_sess memory within transport_free_session().
>> + */
>> + if (acl)
>> + kref_get(&acl->acl_kref);
>
> І think the comment is highly confusing as it's about one of the
> callers, while the function has many.
>
> I'd suggest you move it to core_tpg_check_initiator_node_acl instead.
>
> Also I think iscsit_build_sendtargets_response will need a put on
> the nacl, otherwise you'll leak references.

Indeed. All error paths in all target drivers will have to be modified
to avoid that an acl reference leak is triggered if
transport_init_session() fails after core_tpg_check_initiator_node_acl()
succeeded.

Bart.

\
 
 \ /
  Last update: 2016-01-08 10:21    [W:0.060 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site