1. 27 4月, 2010 1 次提交
    • N
      nfsd4: bug in read_buf · 2bc3c117
      Neil Brown 提交于
      When read_buf is called to move over to the next page in the pagelist
      of an NFSv4 request, it sets argp->end to essentially a random
      number, certainly not an address within the page which argp->p now
      points to.  So subsequent calls to READ_BUF will think there is much
      more than a page of spare space (the cast to u32 ensures an unsigned
      comparison) so we can expect to fall off the end of the second
      page.
      
      We never encountered thsi in testing because typically the only
      operations which use more than two pages are write-like operations,
      which have their own decoding logic.  Something like a getattr after a
      write may cross a page boundary, but it would be very unusual for it to
      cross another boundary after that.
      
      Cc: stable@kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2bc3c117
  2. 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
  3. 07 3月, 2010 1 次提交
  4. 05 3月, 2010 1 次提交
    • C
      dquot: move dquot initialization responsibility into the filesystem · 907f4554
      Christoph Hellwig 提交于
      Currently various places in the VFS call vfs_dq_init directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the initialization.   For most metadata operations
      this is a straight forward move into the methods, but for truncate and
      open it's a bit more complicated.
      
      For truncate we currently only call vfs_dq_init for the sys_truncate case
      because open already takes care of it for ftruncate and open(O_TRUNC) - the
      new code causes an additional vfs_dq_init for those which is harmless.
      
      For open the initialization is moved from do_filp_open into the open method,
      which means it happens slightly earlier now, and only for regular files.
      The latter is fine because we don't need to initialize it for operations
      on special files, and we already do it as part of the namespace operations
      for directories.
      
      Add a dquot_file_open helper that filesystems that support generic quotas
      can use to fill in ->open.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      907f4554
  5. 04 3月, 2010 3 次提交
  6. 25 2月, 2010 1 次提交
  7. 21 2月, 2010 1 次提交
    • B
      commit_metadata export operation replacing nfsd_sync_dir · f501912a
      Ben Myers 提交于
      - Add commit_metadata export_operation to allow the underlying filesystem to
      decide how to commit an inode most efficiently.
      
      - Usage of nfsd_sync_dir and write_inode_now has been replaced with the
      commit_metadata function that takes a svc_fh.
      
      - The commit_metadata function calls the commit_metadata export_op if it's
      there, or else falls back to sync_inode instead of fsync and write_inode_now
      because only metadata need be synced here.
      
      - nfsd4_sync_rec_dir now uses vfs_fsync so that commit_metadata can be static
      Signed-off-by: NBen Myers <bpm@sgi.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      f501912a
  8. 20 2月, 2010 1 次提交
  9. 09 2月, 2010 2 次提交
    • D
      tree-wide: Assorted spelling fixes · 3ad2f3fb
      Daniel Mack 提交于
      In particular, several occurances of funny versions of 'success',
      'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
      'beginning', 'desirable', 'separate' and 'necessary' are fixed.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: Joe Perches <joe@perches.com>
      Cc: Junio C Hamano <gitster@pobox.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      3ad2f3fb
    • J
      Revert "nfsd4: fix error return when pseudoroot missing" · 260c64d2
      J. Bruce Fields 提交于
      Commit f39bde24 fixed the error return from PUTROOTFH in the
      case where there is no pseudofilesystem.
      
      This is really a case we shouldn't hit on a correctly configured server:
      in the absence of a root filehandle, there's no point accepting version
      4 NFS rpc calls at all.
      
      But the shared responsibility between kernel and userspace here means
      the kernel on its own can't eliminate the possiblity of this happening.
      And we have indeed gotten this wrong in distro's, so new client-side
      mount code that attempts to negotiate v4 by default first has to work
      around this case.
      
      Therefore when commit f39bde24 arrived at roughly the same
      time as the new v4-default mount code, which explicitly checked only for
      the previous error, the result was previously fine mounts suddenly
      failing.
      
      We'll fix both sides for now: revert the error change, and make the
      client-side mount workaround more robust.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      260c64d2
  10. 07 2月, 2010 3 次提交
  11. 30 1月, 2010 1 次提交
  12. 28 1月, 2010 1 次提交
    • C
      NFSD: Create PF_INET6 listener in write_ports · 37498292
      Chuck Lever 提交于
      Try to create a PF_INET6 listener for NFSD, if IPv6 is enabled in the
      kernel.
      
      Make sure nfsd_serv's reference count is decreased if
      __write_ports_addxprt() failed to create a listener.  See
      __write_ports_addfd().
      
      Our current plan is to rely on rpc.nfsd to create appropriate IPv6
      listeners when server-side NFS/IPv6 support is desired.  Legacy
      behavior, via the write_threads or write_svc kernel APIs, will remain
      the same -- only IPv4 listeners are created.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      [bfields@citi.umich.edu: Move error-handling code to end]
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      37498292
  13. 27 1月, 2010 1 次提交
    • C
      SUNRPC: NFS kernel APIs shouldn't return ENOENT for "transport not found" · 68717908
      Chuck Lever 提交于
      write_ports() converts svc_create_xprt()'s ENOENT error return to
      EPROTONOSUPPORT so that rpc.nfsd (in user space) can report an error
      message that makes sense.
      
      It turns out that several of the other kernel APIs rpc.nfsd use can
      also return ENOENT from svc_create_xprt(), by way of lockd_up().
      
      On the client side, an NFSv2 or NFSv3 mount request can also return
      the result of lockd_up().  This error may also be returned during an
      NFSv4 mount request, since the NFSv4 callback service uses
      svc_create_xprt() to create the callback listener.  An ENOENT error
      return results in a confusing error message from the mount command.
      
      Let's have svc_create_xprt() return EPROTONOSUPPORT instead of ENOENT.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      68717908
  14. 15 1月, 2010 1 次提交
  15. 13 1月, 2010 3 次提交
  16. 07 1月, 2010 1 次提交
  17. 21 12月, 2009 1 次提交
  18. 20 12月, 2009 1 次提交
  19. 17 12月, 2009 2 次提交
  20. 16 12月, 2009 9 次提交
  21. 15 12月, 2009 4 次提交