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