Re: closefd: closes a file of any process

©[@ÄØÿ¿8þÿ¿Mike A. Harris (uaca@alumni.uv.es)
Tue, 27 Jun 2000 11:22:27 +0200


On Sat, Jun 24, 2000 at 11:01:43AM +0100, Tigran Aivazian wrote:
> On Fri, 23 Jun 2000, Manfred Spraul wrote:
>
> > From: "Tigran Aivazian" <tigran@veritas.com>
> > >
> > > So, I still think that at the moment there is NO (neither kernel nor
> > > userspace) way to close a given process' file descriptor. To do that one
> > > needs to (at least, there are lots of other issues!) enhance the lock
> > > subsystem to get rid of all references to 'current' context (used for
> > > deadlock avoidance detection, presumably).
> >
> > I don't see the the deadlock, where is the problem?
>
> the problem is not a deadlock but the fact that locking algorithms refer
> to 'current' explicitly - see the problem now?

At least in a 2.2.x kernel the only locks.c's function called from
filp_close is locks_remove_posix, and the only reference to current
is in the call to locks_wake_up_blocks:

if (wait) {
/* Let the blocked process remove waiter from the
* block list when it gets scheduled.
*/
current->policy |= SCHED_YIELD;
schedule();
} else {
/* Remove waiter from the block list, because by the
* time it wakes up blocker won't exist any more.
*/
locks_delete_block(blocker, waiter);
}

__but__ filp calls locs_wake_up_blocks __always__ with wait = 0

so it seems there is no a problem here

Ulisses

Debian/GNU Linux: a dream come true
-----------------------------------------------------------------------------
"Computers are useless. They can only give answers." Pablo Picasso

---> Visita http://www.valux.org/ para saber acerca de la <---
---> Asociación Valenciana de Usuarios de Linux <---

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