Linux NFS development
 help / color / mirror / Atom feed
From: Aaron Straus <aaron-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
To: neilb-YbfuJp6tym7X/JP9YwkgDA@public.gmane.org,
	nfs@lists.sourceforge.net, trond.myklebust@fys.uio.no,
	linux-kernel@vger.kernel.org
Subject: [NFS] blocks of zeros (NULLs) in NFS files in kernels >= 2.6.20
Date: Fri, 5 Sep 2008 12:19:40 -0700	[thread overview]
Message-ID: <20080905191939.GG22796@merfinllc.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]

Hi all,

  We're hitting some bad behavior in NFS v3.  The situation is this:

   machine A - NFS server

   machine B - NFS client (writer)
   machine C - NFS client (reader)

   (all machines x86 SMP)

  machine A exports a directory on ext3 filesystem:

	/srv/home       192.168.0.0/24(rw,sync,no_subtree_check)

  machines B and C mount that directory normally

        mount A:/srv/home /mntpnt

  machine B opens a file and writes to it (think a log file)

  machine C stats that file, opens it and reads it (think tailing the
                                                    log file)


  The issue is that machine C will often see large blocks of NULLs
(zeros) in the file.  If you do the same read again just after you see
the block of NULLs you will see proper the data.

  Attached are two simple python programs that demonstrate the problem.

  To use them (they will write to a file called test-nfs in CWD):

 (on machine B in one window)

   python writer.py

 (on machine C in another window)

   python reader.py

  
  reader.py will die when it sees NULLs in the file.  Usually for us
this happens after about 60s (two timeouts I think).   The first NULL is
usually either at index 4000 or 8000 depending on the kernel.


  Now the version of the kernel the server is running doesn't seem to
matter.  The reader also doesn't seem to matter (though I didn't test
this completely).  The writer seems to be the issue:

  Writer_Version     Outcome:
  <= 2.6.19          OK
  >= 2.6.20	     BAD

  I've tested both vanilla kernel.org kernels and Ubuntu 8.04 kernels.

  I can try to bisect between 2.6.19 <-> 2.6.20. 

  Anyone else hitting this problem?  Any better ideas?


  					Thanks,
					=a=


   
-- 
===================
Aaron Straus
aaron-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org

[-- Attachment #2: reader.py --]
[-- Type: text/x-python, Size: 844 bytes --]

#!/usr/bin/env python
import time
import os

def run(file_name):
    data = ''
    last_data_len = len(data)
    last_size = os.stat(file_name).st_size

    while True:
        st_size = os.stat(file_name).st_size
        if st_size != last_size:
            print 'size changed @ %s' % time.asctime()

        data = open(file_name).read()

        if len(data) != last_data_len:
            print 'new data arrived @ %s' % time.asctime()
            print repr(data[-50:])


        if '\0' in data:
            first_index = data.index('\0')
            data_fragment = data[first_index-50:first_index+50]
            print 'Detected NULL @ %d %s' % (first_index, repr(data_fragment))
            break

        time.sleep(0.250)

        last_data_len = len(data)
        last_size = st_size

if __name__ == '__main__':
    run('test-nfs')

[-- Attachment #3: writer.py --]
[-- Type: text/x-python, Size: 257 bytes --]

#!/usr/bin/env python
import time

def run(file_name):
    fp = open(file_name, 'w')

    count = 1

    while count:
        fp.write('meow\n' * 800)
        fp.flush()
        time.sleep(32)

    fp.close()

if __name__ == '__main__':
    run('test-nfs')

[-- Attachment #4: Type: text/plain, Size: 363 bytes --]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

[-- Attachment #5: Type: text/plain, Size: 362 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that nfs@lists.sourceforge.net is being discontinued.
Please subscribe to linux-nfs@vger.kernel.org instead.
    http://vger.kernel.org/vger-lists.html#linux-nfs

             reply	other threads:[~2008-09-05 19:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 19:19 Aaron Straus [this message]
     [not found] ` <20080905191939.GG22796-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-05 19:56   ` [NFS] blocks of zeros (NULLs) in NFS files in kernels >= 2.6.20 Chuck Lever
2008-09-05 20:04     ` Aaron Straus
     [not found]       ` <20080905200455.GH22796-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-05 20:36         ` Chuck Lever
2008-09-05 22:14           ` Aaron Straus
2008-09-06  0:03     ` Aaron Straus
2008-09-08 19:02     ` Aaron Straus
     [not found]       ` <20080908190212.GF28123-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-08 21:15         ` Chuck Lever
     [not found]           ` <76bd70e30809081415h6b55a8dfl8171634c576ac946-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-08 22:02             ` Aaron Straus
2008-09-09 19:46             ` Aaron Straus
     [not found]               ` <20080909194644.GI5290-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-11 16:55                 ` Chuck Lever
2008-09-11 17:19                   ` Aaron Straus
     [not found]                     ` <20080911171908.GE12037-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-11 17:48                       ` Chuck Lever
2008-09-11 18:49                         ` Aaron Straus
     [not found]                           ` <20080911184951.GB19054-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-22 16:05                             ` Hans-Peter Jansen
     [not found]                               ` <200809221805.48463.hpj-2x7n3sizJbFeoWH0uzbU5w@public.gmane.org>
2008-09-22 16:35                                 ` Trond Myklebust
2008-09-22 17:04                                   ` Aaron Straus
     [not found]                                     ` <20080922170414.GC12483-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-22 17:26                                       ` Chuck Lever
     [not found]                                         ` <76bd70e30809221026g7bde774pbffa35881682ea4b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-22 17:37                                           ` Aaron Straus
2008-09-22 17:29                                       ` Trond Myklebust
2008-09-22 17:45                                         ` Aaron Straus
     [not found]                                           ` <20080922174525.GF12483-bYFJunmd+ZV8UrSeD/g0lQ@public.gmane.org>
2008-09-22 18:43                                             ` Aaron Straus
2008-09-22 18:45                                             ` Hans-Peter Jansen
2008-09-22 18:45                                   ` Hans-Peter Jansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080905191939.GG22796@merfinllc.com \
    --to=aaron-byfjunmd+zv8ursed/g0lq@public.gmane.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb-YbfuJp6tym7X/JP9YwkgDA@public.gmane.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox