Re: [PATCH] one of $BIGNUM devfs races

Anton Altaparmakov (aia21@cus.cam.ac.uk)
Tue, 7 Aug 2001 11:21:03 +0100 (BST)


On Mon, 6 Aug 2001, Richard Gooch wrote:
> Alexander Viro writes:
> > On Mon, 6 Aug 2001, Richard Gooch wrote:
> > For local-domain socket you get _two_ kinds of inodes, both with
> > S_IFSOCK in ->i_mode: one on the filesystem (acting like an meeting
> > place) and another - bearing the actual socket and used for all IO.
> >
> > In other words, the only kind you can get from mknod(2) never uses
> > ->i_socket. It's used only by bind() and connect() - and only as
> > a place in namespace. The only thing we ever look at is ownership
> > and permissions - they determine who can bind()/connect() here.
> >
> > So ->u.generic_ip is safe.
>
> Great! That table is toast! All I need is a spinlock-protected
> incrementing counter :-)

If you are introducing a spinlock for the sole purpose of protecting
a counter, I would suggest to drop the spinlock, make the counter an
atomic_t and just use atomic operations on it. That should be both faster
and generate shorter code.

Best regards,

Anton

-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/