> +static int ipath_sma_open(struct inode *in, struct file *fp)
> +{
> + int s;
> +
> + if (ipath_sma_alive) {
> + ipath_dbg("SMA already running (pid %u), failing\n",
> + ipath_sma_alive);
> + return -EBUSY;
> + }
> +
> + for (s = 0; s < atomic_read(&ipath_max); s++) {
> + struct ipath_devdata *dd = ipath_lookup(s);
> + /* we need at least one infinipath device to be initialized. */
> + if (dd && dd->ipath_flags & IPATH_INITTED) {
> + ipath_sma_alive = current->pid;
It seems there's a window here where two processes can both pass the
if (ipath_sma_alive) test and then proceed to step on each other.
- R.
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general