1. 08 5月, 2007 2 次提交
  2. 06 5月, 2007 1 次提交
  3. 05 5月, 2007 2 次提交
    • J
      [CIFS] Make sec=none force an anonymous mount · 8426c39c
      Jeff Layton 提交于
      We had a customer report that attempting to make CIFS mount with a null
      username (i.e. doing an anonymous mount) doesn't work. Looking through the
      code, it looks like CIFS expects a NULL username from userspace in order
      to trigger an anonymous mount. The mount.cifs code doesn't seem to ever
      pass a null username to the kernel, however.
      
      It looks also like the kernel can take a sec=none option, but it only seems
      to look at it if the username is already NULL. This seems redundant and
      effectively makes sec=none useless.
      
      The following patch makes sec=none force an anonymous mount.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8426c39c
    • T
      NFS: Fix a compile glitch on 64-bit systems · 84dde76c
      Trond Myklebust 提交于
      fs/nfs/pagelist.c:226: error: conflicting types for 'nfs_pageio_init'
      include/linux/nfs_page.h:80: error: previous declaration of 'nfs_pageio_init' was here
      
      Thanks to Andrew for spotting this...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      84dde76c
  4. 04 5月, 2007 1 次提交
  5. 03 5月, 2007 23 次提交
  6. 02 5月, 2007 2 次提交
  7. 01 5月, 2007 9 次提交
    • N
      NFS: Fix directory caching problem - with test case and patch. · 83672d39
      Neil Brown 提交于
      Try running this script in an NFS mounted directory (Client relatively
      recent - 2.6.18 has the problem as does 2.6.20).
      
      ------------------------------------------------------
      #!/bin/bash
      #
      # This script will produce the following errormessage from tar:
      #
      #   tar: newdir/innerdir/innerfile: file changed as we read it
      
      # create dirs
      rm -rf nfstest
      mkdir -p nfstest/dir/innerdir
      
      # create files (should not be empty)
      echo "Hello World!" >nfstest/dir/file
      echo "Hello World!" >nfstest/dir/innerdir/innerfile
      
      # problem only happens if we sleep before chmod
      sleep 1
      
      # change file modes
      chmod -R a+r nfstest
      
      # rename dir
      mv nfstest/dir nfstest/newdir
      
      # tar it
      tar -cf nfstest/nfstest.tar -C nfstest newdir
      
      # restore old dir name
      mv nfstest/newdir nfstest/dir
      --------------------------------------------------------
      
      What happens:
      
      The 'chmod -R' does a readdir_plus in each directory and the results
      get cached in the page cache.  It then updates the ctime on each file
      by one second.  When this happens, the post-op attributes are used to
      update the ctime stored on the client to match the value in the kernel.
      
      The 'mv' calls shrink_dcache_parent on the directory tree which
      flushes all the dentries (so a new lookup will be required) but
      doesn't flush the inodes or pagecache.
      
      The 'tar' does a readdir on each directory, but (in the case of
      'innerdir' at least) satisfies it from the pagecache and uses the
      READDIRPLUS data to update all the inodes.  In the case of
      'innerdir/innerfile', the ctime is out of date.
      
      'tar' then calls 'lstat' on innerdir/innerfile getting an old ctime.
      It then opens the file (triggering a GETATTR), reads the content, and
      then calls fstat to see if anything has changed.  It finds that ctime
      has changed and so complains.
      
      The problem seems to be that the cache readdirplus info is kept around
      for too long.
      
      My patch below discards pagecache data for directories when
      dentry_iput is called on them.  This effectively removes the symptom
      which convinces me that I correctly understand the problem.  However
      I'm not convinced that is a proper solution, as there could easily be
      other races that trigger the same problem without being affected by
      this 'fix'.
      
      One possibility would be to require that readdirplus pagecache data be
      only used *once* to instantiate an inode.  Somehow it should then be
      invalidated so that if the dentry subsequently disappears, it will
      cause a new request to the server to fill in the stat data.
      
      Another possibility is to compare the cache_change_attribute on the
      inode with something similar for the readdirplus info and reject the
      info from readdirplus if it is too old.
      
      I haven't tried to implement these and would value other opinions
      before I do.
      
      Thanks,
      NeilBrown
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      83672d39
    • N
      NFS: Set meaningful value for fattr->time_start in readdirplus results. · 1f4eab7e
      Neil Brown 提交于
      Don't use uninitialsed value for fattr->time_start in readdirplus results.
      
      The 'fattr' structure filled in by nfs3_decode_direct does not get a
      value for ->time_start set.
      Thus if an entry is for an inode that we already have in cache,
      when nfs_readdir_lookup calls nfs_fhget, it will call nfs_refresh_inode
      and may update the inode with out-of-date information.
      
      Directories are read a page at a time, so each page could have a
      different timestamp that "should" be used to set the time_start for
      the fattr for info in that page.  However storing the timestamp per
      page is awkward.  (We could stick in the first 4 bytes and only read 4092
      bytes, but that is a bigger code change than I am interested it).
      
      This patch ignores the readdir_plus attributes if a readdir finds the
      information already in cache, and otherwise sets ->time_start to the time
      the readdir request was sent to the server.
      
      It might be nice to store - in the directory inode - the time stamp for
      the earliest readdir request that is still in the page cache, so that we
      don't ignore attribute data that we don't have to.  This patch doesn't do
      that.
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1f4eab7e
    • S
      NFS: Added support to turn off the NFSv3 READDIRPLUS RPC. · 74dd34e6
      Steve Dickson 提交于
      READDIRPLUS can be a performance hindrance when the client is working with
      large directories. In addition, some servers still have bugs in their
      implementations (e.g. Tru64 returns wrong values for the fsid).
      
      Add a mount flag to enable users to turn it off at mount time following the
      implementation in Apple's NFS client.
      Signed-off-by: NSteve Dickson <steved@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      74dd34e6
    • C
    • C
      NFS: switch NFSROOT to use new rpcbind client · df8b172a
      Chuck Lever 提交于
      It is arguable whether NFSROOT will support IPv6, and thus whether
      rpcb_getport_external needs to support rpcbind versions greater than 2.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      df8b172a
    • C
      SUNRPC: RPC buffer size estimates are too large · 2bea90d4
      Chuck Lever 提交于
      The RPC buffer size estimation logic in net/sunrpc/clnt.c always
      significantly overestimates the requirements for the buffer size.
      A little instrumentation demonstrated that in fact rpc_malloc was never
      allocating the buffer from the mempool, but almost always called kmalloc.
      
      To compute the size of the RPC buffer more precisely, split p_bufsiz into
      two fields; one for the argument size, and one for the result size.
      
      Then, compute the sum of the exact call and reply header sizes, and split
      the RPC buffer precisely between the two.  That should keep almost all RPC
      buffers within the 2KiB buffer mempool limit.
      
      And, we can finally be rid of RPC_SLACK_SPACE!
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2bea90d4
    • C
      NLM: Shrink the maximum request size of NLM4 requests · 511d2e88
      Chuck Lever 提交于
      NLM version 4 requests estimate the call and reply header sizes rather
      conservatively, using the very maximum size allowed in the protocol even
      though Linux always uses only a small fraction of the allowable space.
      
      Reduce the size of caller and lock arguments to conserve RPC buffer space
      while XDR encoding NLM4 arguments.  Add compile-time checks to ensure the
      hostname string won't overflow NLM protocol maximums.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      511d2e88
    • T
    • T
      NFS: Clean up nfs_sync_mapping_wait() · 724c439c
      Trond Myklebust 提交于
      It has no business touching wbc->pages_skipped.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      724c439c