Re: [PATCH 9 of 20] ipath - char devices for diagnostics and lightweight subnet management

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

 



 > +static int ipath_sma_release(struct inode *in, struct file *fp)
 > +{
 > +	int s;
 > +
 > +	ipath_sma_alive = 0;
 > +	ipath_cdbg(SMA, "Closing SMA device\n");
 > +	for (s = 0; s < atomic_read(&ipath_max); s++) {
 > +		struct ipath_devdata *dd = ipath_lookup(s);
 > +
 > +		if (!dd || !(dd->ipath_flags & IPATH_INITTED))
 > +			continue;
 > +		*dd->ipath_statusp &= ~IPATH_STATUS_SMA;
 > +		if (dd->verbs_layer.l_flags & IPATH_VERBS_KERNEL_SMA)
 > +			*dd->ipath_statusp |= IPATH_STATUS_OIB_SMA;
 > +	}
 > +	return 0;
 > +}

Similarly what protects against another process opening the device
right after the ipath_sma_alive = 0 setting, but before you do all the
cleanup that's after that?

And what protects against a hot unplug of a device after the test of s
against ipath_max?

 - 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]
  Powered by Linux