Re: event->global_event

manfreds@colorfullife.com
Tue, 21 Dec 1999 07:52:10 -0500


Zitiere Neil Brown <neilb@cse.unsw.edu.au>:
> >
> > * inode->i_version, file->f_version.
> > a) files: it\'s nowhere read, but it\'s updated by a
few functions (eg
> > default_llseek(), but not by generic_file_read()
although both functions
> > modify the file pionter)
> >
> > ---> it\'s superflous, remove it!
>
> Would removing it for files but leaving it for
directories just add
> lots of extra conditionals?
>
Several functions are only called for files, e.g.
ext2_file_lseek().
I agree that itīs more a documentation change than a
real code change.

> >
> > Btw, AFAICS, then SMP protection for the read-ahead
information in
> > generic_file_read() is missing. I don\'t know if
this is dangerous.
> > Perhaps we should add a spinlock to each filp?
>
> If two separate processes (or threads) are reading on
the same file,
> then weird things happen anyway. f_pos is not
updated atomically so
> if, for example you have:
>
> fd = open(\"afile\", O_RDONLY);
> if (fork()) {
> read(fd, buf, 1024);
> ...
> } else {
> read(fd, buf, 1024);
> }

There was a short discussion a few weeks ago, and the
result was that the behaviour for concurrent read()
calls to the same filp is undefined.
But: I donīt know if a corrupted read-ahead information
could cause crashes.

--
        Manfred

----------------------------------------------------- This mail sent through IMP: http://web.horde.org/imp/

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