> +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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]