lkml.org 
[lkml]   [2009]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: epoll and closed file descriptors
Date
Davide wrote:
> On Wed, 16 Sep 2009, Gilad Benjamini wrote:
>
> > I would, but epoll is preventing me from doing so.
> > Early in sys_epoll_ctl there are these lines
> >
> > file = fget(epfd);
> > if (!file)
> > goto error_return;
> >
> > Leaving me in a kind of dead lock
>
> The 'epfd' in there, is the _epoll fd_, which, if fget() fails, means
> you
> close it.
> You see likely failing the 'tfile = fget(fd)' (of course, you closed
> it),
> so if someone else keeps the socket open and you have no chance in
> telling
> it to drop it (really?), you need to remove the socket from the set
> before
> closing it.
>
>
>
> - Davide

My bad. I meant to quote the line that you mentioned.
I agree that the right thing to do is to remove the fd from epoll before
closing it.
However, due to the way curl works, I cannot do that. Changing the curl code
doesn't seem trivial.

Regardless, I still don't see how the kernel got into this situation, and if
this situation is valid, why it doesn't bail out of it.




\
 
 \ /
  Last update: 2009-09-17 02:43    [W:0.075 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site