Re: Bad FS behavior w/ testcase

From: Dr. Michael Weller (eowmob@exp-math.uni-essen.de)
Date: Wed Mar 29 2000 - 09:33:43 EST


On 29 Mar 2000, Matija Nalis wrote:

> >int main()
> >{
> > int fd = open(FILENAME, O_RDWR | O_CREAT | O_TRUNC, 0600);
> > if(fd>0) {
> > unlink(FILENAME); /* The file is gone */
>
> No, the file is not gone. Specific named reference to file is gone.
>
> There could be more references to the same file (same inode). There could be
> more processes that have that file opened and want to read/write from it.
> Even this same process may want to seek on this file and read something it
> had written before.

Well, yes. But he said the write back was caused by the close caused by
the exit. In theory, the close syscall could check if only 1 reference
to the inode was left and if so discard all changes. Now, I don't know
how difficult that would be, so I won't say someone should add it.

Michael.

--

Michael Weller: eowmob@exp-math.uni-essen.de, eowmob@ms.exp-math.uni-essen.de, or even mat42b@spi.power.uni-essen.de. If you encounter an eowmob account on any machine in the net, it's very likely it's me.

- 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/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:24 EST