1. 13 9月, 2010 1 次提交
    • M
      statfs() gives ESTALE error · fbf3fdd2
      Menyhart Zoltan 提交于
      Hi,
      
      An NFS client executes a statfs("file", &buff) call.
      "file" exists / existed, the client has read / written it,
      but it has already closed it.
      
      user_path(pathname, &path) looks up "file" successfully in the
      directory-cache  and restarts the aging timer of the directory-entry.
      Even if "file" has already been removed from the server, because the
      lookupcache=positive option I use, keeps the entries valid for a while.
      
      nfs_statfs() returns ESTALE if "file" has already been removed from the
      server.
      
      If the user application repeats the statfs("file", &buff) call, we
      are stuck: "file" remains young forever in the directory-cache.
      Signed-off-by: NZoltan Menyhart  <Zoltan.Menyhart@bull.net>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@kernel.org
      fbf3fdd2
  2. 11 8月, 2010 1 次提交
  3. 10 8月, 2010 1 次提交
  4. 07 8月, 2010 1 次提交
  5. 23 6月, 2010 1 次提交
  6. 25 5月, 2010 1 次提交
  7. 15 5月, 2010 6 次提交
  8. 29 4月, 2010 1 次提交
    • X
      nfs: fix memory leak in nfs_get_sb with CONFIG_NFS_V4 · 9699eda6
      Xiaotian Feng 提交于
      With CONFIG_NFS_V4 and data version 4, nfs_get_sb will allocate memory for
      export_path in nfs4_validate_text_mount_data, so we need to free it then.
      This is addressed in following kmemleak report:
      
      unreferenced object 0xffff88016bf48a50 (size 16):
        comm "mount.nfs", pid 22567, jiffies 4651574704 (age 175471.200s)
        hex dump (first 16 bytes):
          2f 6f 70 74 2f 77 6f 72 6b 00 6b 6b 6b 6b 6b a5  /opt/work.kkkkk.
        backtrace:
          [<ffffffff814b34f9>] kmemleak_alloc+0x60/0xa7
          [<ffffffff81102c76>] kmemleak_alloc_recursive.clone.5+0x1b/0x1d
          [<ffffffff811046b3>] __kmalloc_track_caller+0x18f/0x1b7
          [<ffffffff810e1b08>] kstrndup+0x37/0x54
          [<ffffffffa0336971>] nfs_parse_devname+0x152/0x204 [nfs]
          [<ffffffffa0336af3>] nfs4_validate_text_mount_data+0xd0/0xdc [nfs]
          [<ffffffffa0338deb>] nfs_get_sb+0x325/0x736 [nfs]
          [<ffffffff81113671>] vfs_kern_mount+0xbd/0x17c
          [<ffffffff81113798>] do_kern_mount+0x4d/0xed
          [<ffffffff81129a87>] do_mount+0x787/0x7fe
          [<ffffffff81129b86>] sys_mount+0x88/0xc2
          [<ffffffff81009b42>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NXiaotian Feng <dfeng@redhat.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: Benny Halevy <bhalevy@panasas.com>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Cc: Andy Adamson <andros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      9699eda6
  9. 23 4月, 2010 1 次提交
  10. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. 16 3月, 2010 1 次提交
  12. 03 2月, 2010 1 次提交
  13. 18 12月, 2009 1 次提交
    • L
      Revert "fix mismerge with Trond's stuff (create_mnt_ns() export is gone now)" · a2770d86
      Linus Torvalds 提交于
      This reverts commit e9496ff4. Quoth Al:
      
       "it's dependent on a lot of other stuff not currently in mainline
        and badly broken with current fs/namespace.c.  Sorry, badly
        out-of-order cherry-pick from old queue.
      
        PS: there's a large pending series reworking the refcounting and
        lifetime rules for vfsmounts that will, among other things, allow to
        rip a subtree away _without_ dissolving connections in it, to be
        garbage-collected when all active references are gone.  It's
        considerably saner wrt "is the subtree busy" logics, but it's nowhere
        near being ready for merge at the moment; this changeset is one of the
        things becoming possible with that sucker, but it certainly shouldn't
        have been picked during this cycle.  My apologies..."
      Noticed-by: NEric Paris <eparis@redhat.com>
      Requested-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2770d86
  14. 17 12月, 2009 1 次提交
  15. 04 12月, 2009 3 次提交
    • C
      NFS: Revert default r/wsize behavior · dd47f96c
      Chuck Lever 提交于
      When the "rsize=" or "wsize=" mount options are not specified,
      text-based mounts have slightly different behavior than legacy binary
      mounts.  Text-based mounts use the smaller of the server's maximum
      and the client's maximum, but binary mounts use the smaller of the
      server's _preferred_ size and the client's maximum.
      
      This difference is actually pretty subtle.  Most servers advertise
      the same value as their maximum and their preferred transfer size, so
      the end result is the same in most cases.
      
      The reason for this difference is that for text-based mounts, if
      r/wsize are not specified, they are set to the largest value supported
      by the client.  For legacy mounts, the values are set to zero if these
      options are not specified.
      
      nfs_server_set_fsinfo() can negotiate the transfer size defaults
      correctly in any case.  There's no need to specify any particular
      value as default in the text-based option parsing logic.
      
      Note that nfs4 doesn't use nfs_server_set_fsinfo(), but the mount.nfs4
      command does set rsize and wsize to 0 if the user didn't specify these
      options.  So, make the same change for text-based NFSv4 mounts.
      
      Thanks to James Pearson <james-p@moving-picture.com> for reporting and
      diagnosing the problem.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      dd47f96c
    • C
      NFS: Display compressed (shorthand) IPv6 in /proc/mounts · d250e190
      Chuck Lever 提交于
      Recent changes to snprintf() introduced the %pI6c formatter, which can
      display an IPv6 address with standard shorthanding.  Use this new
      formatter when displaying IPv6 server addresses in /proc/mounts.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d250e190
    • J
      NFS: convert proto= option to use netids rather than a protoname · ee671b01
      Jeff Layton 提交于
      Solaris uses netids as values for the proto= option, so that when
      someone specifies "tcp6" they get traffic over TCP + IPv6. Until
      recently, this has never really been an issue for Linux since it didn't
      support NFS over IPv6. The netid and the protocol name were generally
      always the same (modulo any strange configuration in /etc/netconfig).
      
      The solaris manpage documents their proto= option as:
      
          proto= _netid_ | rdma
      
      This patch is intended to bring Linux closer to how the Solaris proto=
      option works, by declaring a static netid mapping in the kernel and
      converting the proto= and mountproto= options to follow it and display
      the proper values in /proc/mounts.
      
      Much of this functionality will need to be provided by a userspace
      mount.nfs patch. Chuck Lever has a patch to change mount.nfs in
      the same way. In principle, we could do *all* of this in userspace but
      that would mean that the options in /proc/mounts may not match the
      options used by userspace.
      
      The alternative to the static mapping here is to add a mechanism to
      upcall to userspace for netid's. I'm not opposed to that option, but
      it'll probably mean more overhead (and quite a bit more code). Rather
      than shoot for that at first, I figured it was probably better to
      start simply.
      
      Comments welcome.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ee671b01
  16. 03 12月, 2009 1 次提交
  17. 22 10月, 2009 1 次提交
  18. 13 10月, 2009 1 次提交
  19. 08 10月, 2009 1 次提交
    • T
      NFSv4: Kill nfs4_renewd_prepare_shutdown() · 3050141b
      Trond Myklebust 提交于
      The NFSv4 renew daemon is shared between all active super blocks that refer
      to a particular NFS server, so it is wrong to be shutting it down in
      nfs4_kill_super every time a super block is destroyed.
      
      This patch therefore kills nfs4_renewd_prepare_shutdown altogether, and
      leaves it up to nfs4_shutdown_client() to also shut down the renew daemon
      by means of the existing call to nfs4_kill_renewd().
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      3050141b
  20. 07 10月, 2009 3 次提交
  21. 25 9月, 2009 1 次提交
  22. 24 9月, 2009 3 次提交
  23. 21 9月, 2009 1 次提交
  24. 16 9月, 2009 1 次提交
  25. 09 9月, 2009 5 次提交