Re: [RFC PATCH 3/9] target: add helper to find se_device by dev_index

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

 



On Mon, 2017-06-12 at 05:10 -0500, Mike Christie wrote:
> +struct se_device *target_find_device(int id)
> +{
> +	struct se_device *dev;
> +
> +	mutex_lock(&g_device_mutex);
> +	dev = idr_find(&devices_idr, id);
> +	mutex_unlock(&g_device_mutex);
> +	return dev;
> +}
> +EXPORT_SYMBOL(target_find_device);

Hello Mike,

Since target_find_device() does not increase any reference count, how is code
that uses the return value of target_find_device() protected against concurrent
removal of the returned device?

Thanks,

Bart.--
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