All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Grover <agrover@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 5/6] target: Allocate se_luns only when used
Date: Fri, 07 Mar 2014 10:31:57 -0800	[thread overview]
Message-ID: <531A109D.4030007@redhat.com> (raw)
In-Reply-To: <20140307182232.GA5474@infradead.org>

On 03/07/2014 10:22 AM, Christoph Hellwig wrote:
> On Fri, Mar 07, 2014 at 10:12:09AM -0800, Andy Grover wrote:
>>> I can't see how the synchronization can work without refcounting the lun
>>> structure.  The lock just protectes the assignment, but you free it
>>> right after.  What happens to how jsut dereferenced it under the lock
>>> but then uses it outside (e.g. core_dev_add_initiator_node_lun_acl).
>>
>> Well you're right, but this is one instance of a larger lio
>> locking/refcounting hairball. This will be addressed in a separate
>> patch series.
>
> I don't think that's true. Before your series we might be accessing a
> lun structure that was marked as not active just before, but now the
> race becomes a genuine use after free.

OK. I'll work on a follow-on patch that ensures the locks are held long 
enough.

Thanks -- Andy

  reply	other threads:[~2014-03-07 18:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 22:15 [PATCH 0/6] target: Save memory on unused se_dev_entrys and se_luns Andy Grover
2014-03-06 22:15 ` [PATCH 1/6] target: Allocate se_dev_entrys in device list only when used Andy Grover
2014-03-07 10:33   ` Christoph Hellwig
2014-03-06 22:15 ` [PATCH 2/6] target: core_tpg_post_dellun can return void Andy Grover
2014-03-06 22:15 ` [PATCH 3/6] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun Andy Grover
2014-03-07 10:35   ` Christoph Hellwig
2014-03-07 18:20     ` Andy Grover
2014-03-06 22:15 ` [PATCH 4/6] target: Rename core_tpg_post_dellun to remove_lun Andy Grover
2014-03-06 22:15 ` [PATCH 5/6] target: Allocate se_luns only when used Andy Grover
2014-03-07 10:41   ` Christoph Hellwig
2014-03-07 18:12     ` Andy Grover
2014-03-07 18:22       ` Christoph Hellwig
2014-03-07 18:31         ` Andy Grover [this message]
2014-03-12 19:04         ` Nicholas A. Bellinger
2014-03-06 22:15 ` [PATCH 6/6] target: Remove core_tpg_release_virtual_lun0 function Andy Grover
2014-03-07 17:50 ` [PATCH 7/6] target: Do not allocate device_list and tpg_lun_list arrays separately Andy Grover
2014-03-10 22:45 ` [PATCHv2 0/9] target: Save memory on unused se_dev_entrys and se_luns Andy Grover
2014-03-10 22:45   ` [PATCHv2 1/9] target: Add locking to some accesses to nacl.device_list Andy Grover
2014-03-10 22:45   ` [PATCHv2 2/9] target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs Andy Grover
2014-03-10 22:45   ` [PATCHv2 3/9] target: Allocate se_dev_entrys in device list only when used Andy Grover
2014-03-10 22:45   ` [PATCHv2 4/9] target: core_tpg_post_dellun can return void Andy Grover
2014-03-10 22:45   ` [PATCHv2 5/9] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun Andy Grover
2014-03-10 22:45   ` [PATCHv2 6/9] target: Rename core_tpg_post_dellun to remove_lun Andy Grover
2014-03-10 22:45   ` [PATCHv2 7/9] target: Allocate se_luns only when used Andy Grover
2014-03-10 22:45   ` [PATCHv2 8/9] target: Remove core_tpg_release_virtual_lun0 function Andy Grover
2014-03-10 22:45   ` [PATCHv2 9/9] target: Refactor core_enable_device_list_for_node Andy Grover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=531A109D.4030007@redhat.com \
    --to=agrover@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.