Re: [PATCH 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

From: Nicholas A. Bellinger
Date: Mon May 25 2015 - 18:59:29 EST


On Fri, 2015-05-22 at 13:56 +0200, Christoph Hellwig wrote:
> > @@ -683,7 +679,7 @@ void core_tpg_remove_lun(
> > dev->export_count--;
> > spin_unlock(&dev->se_port_lock);
> >
> > - lun->lun_se_dev = NULL;
> > + rcu_assign_pointer(lun->lun_se_dev, NULL);
> > }
>
> What guarantees that the se_device stays around for at least a RCU
> grace period after this assignment?

Nothing.

Since se_device is embedded in the backend driver device structure, this
currently requires that each driver do it's own call_rcu().