Re: [patch] eventfd - revised interface and cleanups

From: Davide Libenzi
Date: Tue Jun 23 2009 - 13:57:49 EST


On Tue, 23 Jun 2009, Gregory Haskins wrote:

> I think the lack of a way to got from a file* to a ctx* (or back) might
> be a problem. I am not an expert, but if I understood the gist of what
> Al Viro (cc'd) was saying early on, an fd can change meaning out from
> under you without warning.
>
> With the code the way it is now, I would need to call both
> eventfd_fget() and eventfd_ctx_fdget() to fully acquire state (unless I
> am missing something). I would think that is a race and I am not
> guaranteed to get the same object. Can we also have a way to convert
> one reference to the other? I am thinking
>
> struct eventfd_ctx *eventfd_ctx_fget(struct file *)
>
> (or similar) would be sufficient.

You're right. That function was available in the previous patch, but then
I dropped it because I thought the eventfd code could be simplified. But
yes, it's needed.



- Davide


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