On Wed, 20 Jun 2007, Timo Sirainen wrote:
> > It will occur if you are reading as someone else changes the file size.
> > Use file locking, it exists for a reason ;)
> Annoying extra overhead. Especially with NFS, when nowadays you can't
> even use flock() to create local locks..
It's not only "n
On Wed, 2007-06-20 at 18:05 +0100, Alan Cox wrote:
> > I thought this wouldn't happen when reading from local filesystems.
> > Anyway, my real program was doing that, and it was still seeing partial
> > data. But looks like I can't reproduce it in my test program with two
> > pread()s, so I'll have
> I thought this wouldn't happen when reading from local filesystems.
> Anyway, my real program was doing that, and it was still seeing partial
> data. But looks like I can't reproduce it in my test program with two
> pread()s, so I'll have to do some more debugging.
It will occur if you are readi
On Wed, 2007-06-20 at 09:22 -0700, Ray Lee wrote:
> On 6/20/07, Timo Sirainen <[EMAIL PROTECTED]> wrote:
> > On Wed, 2007-06-20 at 17:52 +0300, Timo Sirainen wrote:
> > > Sometimes read() returns only 4096 bytes. I'm locking the file, so I
> > > don't think this should ever happen, right?
>
> man
On 6/20/07, Timo Sirainen <[EMAIL PROTECTED]> wrote:
On Wed, 2007-06-20 at 17:52 +0300, Timo Sirainen wrote:
> Sometimes read() returns only 4096 bytes. I'm locking the file, so I
> don't think this should ever happen, right?
man 2 read
read() is always allowed to return less than you asked fo
On Wed, 2007-06-20 at 17:52 +0300, Timo Sirainen wrote:
> Sometimes read() returns only 4096 bytes. I'm locking the file, so I
> don't think this should ever happen, right?
Sorry, the problem was with file truncating so there's no bug with
locking. I didn't notice it first because it happened to w
Tested with various 2.6.x i386/x86-64 SMP kernels and CPUs, for example
2.6.21.3/x86-64.
Process 1:
- lock file
- write(4096 + 16 bytes)
- unlock file
Process 2:
- lock file
- read(8192 bytes)
- unlock file
Sometimes read() returns only 4096 bytes. I'm locking the file, so I
don't think
7 matches
Mail list logo