Re: [PATCH] thread wakeup fix for 2.4.0-test7

From: Alexander Viro (viro@math.psu.edu)
Date: Sun Aug 27 2000 - 14:49:38 EST


On Sun, 27 Aug 2000 kuznet@ms2.inr.ac.ru wrote:

> Hello!
>
> > > File is closed, when all the references from user disappear.
> >
> > Yes? So how about
> > fd2 = dup(fd1);
> > read(fd1,...);
> > close(fd1);
> >
> > Is the file closed in that case? If no - you've got completely weird
> > semantics (having dup() changes rules for operations on original fd), if
> > yes - what happens with your arguments about leaks?
>
> Dup gets another descriptor and another reference.

So _which_ case should abort read()?

> Al, do not pretend, that you do not understand the difference
> between user count and reference count. Man working on VFS knows this
> by defintion. Seems, you jest.

I don't understand why you _need_ user count in the first place.

> fget()/fput() are to be used only to prevent destruction.

Alexey, you are mixing files and descriptors. Look: you want to add some
strange state to the whole thing. Fine. Where should it live? If it's
associated with file - too bad, dup() will prevent aborting read() by
close(). If it's on descriptor - WTF does it have struct file?

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



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:19 EST