NFS client does not fall back to v2 synchronous mode when using O SYNC

From Linux NFS

Revision as of 18:06, 29 July 2011 by Amschuma (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

About

  • Kernel version: 2.6.32 to 2.6.38-rc3
  • Bug 28502
  • Reported by: Stefan Bader (February 7, 2011)
  • Closed by: Trond Myklebust (April 15, 2011)

How to reproduce

  • Used the following in /etc/exports:
/nfs_export (rw,no_root_squash,sync,no_wdelay,no_subtree_check)
  • Mount NFS mount from Client:
sudo mount server:/nfs_export /nfs_mount
  • Start collecting tcpdump data on client and server.
  • Perform a simple dd to cause and NFS write (Using oflag=sync):
strace -o /tmp/strace.dd.joe.out dd if=/dev/zero of=/nfs_mount/syncfile bs=1k count=1 oflag=sync
  • Review tcpdump data and notice the client does not issue the "nfs_file_sync" +-write requests.
    • Client should be in FILE_SYNC mode, but the client would only use FILE_SYNC for retries or writeback writes for reclaim


Resolution

commit b31268ac793fd300da66b9c28bbf0a200339ab96
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
Date:   Mon Mar 21 17:02:00 2011 -0400

    FS: Use stable writes when not doing a bulk flush
    
    If we're only doing a single write, and there are no other unstable
    writes being queued up, we might want to just flip to using a stable
    write RPC call.
    
    Reviewed-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Personal tools