Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbZIQAaV (ORCPT ); Wed, 16 Sep 2009 20:30:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754624AbZIQAaS (ORCPT ); Wed, 16 Sep 2009 20:30:18 -0400 Received: from x35.xmailserver.org ([64.71.152.41]:36390 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754186AbZIQAaR (ORCPT ); Wed, 16 Sep 2009 20:30:17 -0400 X-AuthUser: davidel@xmailserver.org Date: Wed, 16 Sep 2009 17:30:18 -0700 (PDT) From: Davide Libenzi X-X-Sender: davide@makko.or.mcafeemobile.com To: Gilad Benjamini cc: "'Linux Kernel Mailing List'" Subject: RE: epoll and closed file descriptors In-Reply-To: <024601ca372d$09ad9fb0$1d08df10$@com> Message-ID: References: <023c01ca3724$9f90fcb0$deb2f610$@com> <024601ca372d$09ad9fb0$1d08df10$@com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 834 Lines: 28 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 -- 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/