Re: [NFS] blocks of zeros (NULLs) in NFS files in kernels >= 2.6.20

From: Aaron Straus
Date: Mon Sep 08 2008 - 18:02:34 EST

Hi Chuck,

On Sep 08 05:15 PM, Chuck Lever wrote:
> This seems to correspond with the strace logs, which show that you
> stopped the bad run before it generated more writes.

Yes. Sorry. I stopped the writer once the reader saw the NULL bytes.

> Normally this isn't a big deal, as NFS likes applications to serialize
> access to shared files. However, in this case we expect the .flush()
> to force all dirty bytes out at once, and this is definitely not
> occurring....
> The third thing is that I don't see any flush or fsync system calls in
> the strace logs, even though the script invokes fp.flush().
> I'm not terribly familiar with Python's flush(). How do you expect
> the flush() method to work?

I think fp.flush() in Python is equivalent to fflush() i.e. it only
flushes the stdio buffer. It doesn't actually call fsync or fdatasync
or anything like that.

We can pretty easily change the Python code to use the syscall
write()/etc methods.

> I wonder why the client is using FILE_SYNC writes and not
> UNSTABLE+COMMIT. Are the clients using the "sync" mount option? I
> don't see O_SYNC on the open.

I've exported them on the server as sync e.g. in exports:


However I don't give any special options when mounting e.e. on the

mount machine:/export mntpnt

Anyway thanks for looking at this and let me know if I can do anything


Aaron Straus

Attachment: signature.asc
Description: Digital signature