Re: [PATCH 06/12] target/pr: Convert se_dev_entry to kref for RCU

Christoph Hellwig
2015-05-13T05:59:48Z

On Tue, May 12, 2015 at 09:25:30AM +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
>
> This patch converts se_dev_entry->pr_ref_count access to use modern
> struct kref counting.
>
> It updates core_enable_device_list_for_node() to kref_init() when se_dev_entry
> is being enabled, and updates core_disable_device_list_for_node() to kref_put()
> and blocks on ->pr_comp waiting for outstanding PR references to drop.
>
> Also, go ahead and convert core_get_se_deve_from_rtpi() code to use pr_kref
> for RELATIVE TARGET PORT IDENTIFIER lookup.

This seems to be two very different things. Once a fix up of the
->se_deve access in the PR code, and second changing the way the references
work.

The kref change looks fine to me as a standalone patch.

The RCU lookup changes really need to be squashed into the others,
for one thing before this patch the PR code still tries to use
->device_list which isn't even maintained any more.

It might be a good idea to grab these three patches from my older series
and add them before your actual RCU changes to simplify the PR code
in preparation of the RCU changes: