Re: [PATCH 01/12] target: Convert se_node_acl->device_list[] to RCU hlist

Christoph Hellwig
2015-05-17T16:51:42Z

On Wed, May 13, 2015 at 01:46:11AM -0700, Nicholas A. Bellinger wrote:
> Updated to use a mirror lun->lun_rtpi, with the assignment from sep_rtpi
> occuring in core_dev_export() code.

>From looking at your current tree I suspect freeing the se_port structure
using kfree_rcu might be a better idea. Together with dropping the references
to the se_device from call_rcu context this basically means all pointers
in struct se_lun are rcu protected which is much safer if you want
to access struct se_lun under rcu protection, as this avoids having to
deal with special cases. Additionally that basically allows you to
replace lun_sep_lock with rcu_read_lock for anything remotely like
a fast path.