Re: [PATCH 2/5] target: Add se_node_acl->acl_free_comp for NodeACL release path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 February 2012 12:12:51 +0000, Nicholas A. Bellinger wrote:
> @@ -466,18 +468,17 @@ int core_tpg_del_initiator_node_acl(
>  				&tpg->tpg_sess_list, sess_list) {
>  		if (sess->se_node_acl != acl)
>  			continue;
> -		/*
> -		 * Determine if the session needs to be closed by our context.
> -		 */
> -		if (!tpg->se_tpg_tfo->shutdown_session(sess))
> -			continue;
>  
> +		kref_get(&sess->sess_kref);
>  		spin_unlock_irqrestore(&tpg->session_lock, flags);
> -		/*
> -		 * If the $FABRIC_MOD session for the Initiator Node ACL exists,
> -		 * forcefully shutdown the $FABRIC_MOD session/nexus.
> -		 */
> -		tpg->se_tpg_tfo->close_session(sess);
> +
> +		rc = tpg->se_tpg_tfo->shutdown_session(sess);
> +		target_put_session(sess);
> +		if (!rc)
> +			continue;
> +		target_put_session(sess);

This looks wrong.  If we are guaranteed to still hold a refcount,
there is no point in the kref_get(), target_put_session() pair.  If
not, how do we protect against the refcount being 0 at kref_get()
time?

> +		/* Wait for fabric session shutdown to complete.. */
> +		wait_for_completion(&acl->acl_free_comp);
>  
>  		spin_lock_irqsave(&tpg->session_lock, flags);
>  	}

Jörn
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux