1. 01 11月, 2011 1 次提交
  2. 25 10月, 2011 4 次提交
  3. 20 8月, 2011 1 次提交
  4. 15 7月, 2011 2 次提交
  5. 28 5月, 2011 1 次提交
    • C
      SUNRPC: Use AF_LOCAL for rpcbind upcalls · 7402ab19
      Chuck Lever 提交于
      As libtirpc does in user space, have our registration API try using an
      AF_LOCAL transport first when registering and unregistering.
      
      This means we don't chew up privileged ports, and our registration is
      bound to an "owner" (the effective uid of the process on the sending
      end of the transport).  Only that "owner" may unregister the service.
      
      The kernel could probe rpcbind via an rpcbind query to determine
      whether rpcbind has an AF_LOCAL service. For simplicity, we use the
      same technique that libtirpc uses: simply fail over to network
      loopback if creating an AF_LOCAL transport to the well-known rpcbind
      service socket fails.
      
      This means we open-code the pathname of the rpcbind socket in the
      kernel.  For now we have to do that anyway because the kernel's
      RPC over AF_LOCAL implementation does not support autobind.  That may
      be undesirable in the long term.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7402ab19
  6. 07 1月, 2011 3 次提交
  7. 05 1月, 2011 1 次提交
    • J
      svcrpc: simpler request dropping · 9e701c61
      J. Bruce Fields 提交于
      Currently we use -EAGAIN returns to determine when to drop a deferred
      request.  On its own, that is error-prone, as it makes us treat -EAGAIN
      returns from other functions specially to prevent inadvertent dropping.
      
      So, use a flag on the request instead.
      
      Returning an error on request deferral is still required, to prevent
      further processing, but we no longer need worry that an error return on
      its own could result in a drop.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9e701c61
  8. 22 9月, 2010 1 次提交
  9. 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
  10. 07 3月, 2010 1 次提交
  11. 10 2月, 2010 1 次提交
  12. 30 11月, 2009 1 次提交
  13. 18 6月, 2009 4 次提交
  14. 17 6月, 2009 1 次提交
  15. 04 4月, 2009 1 次提交
  16. 30 3月, 2009 1 次提交
  17. 29 3月, 2009 6 次提交
    • C
      SUNRPC: rpcb_register() should handle errors silently · 363f724c
      Chuck Lever 提交于
      Move error reporting for RPC registration to rpcb_register's caller.
      
      This way the caller can choose to recover silently from certain
      errors, but report errors it does not recognize.  Error reporting
      for kernel RPC service registration is now handled in one place.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      363f724c
    • C
      SUNRPC: Simplify kernel RPC service registration · cadc0fa5
      Chuck Lever 提交于
      The kernel registers RPC services with the local portmapper with an
      rpcbind SET upcall to the local portmapper.  Traditionally, this used
      rpcbind v2 (PMAP), but registering RPC services that support IPv6
      requires rpcbind v3 or v4.
      
      Since we now want separate PF_INET and PF_INET6 listeners for each
      kernel RPC service, svc_register() will do only one of those
      registrations at a time.
      
      For PF_INET, it tries an rpcb v4 SET upcall first; if that fails, it
      does a legacy portmap SET.  This makes it entirely backwards
      compatible with legacy user space, but allows a proper v4 SET to be
      used if rpcbind is available.
      
      For PF_INET6, it does an rpcb v4 SET upcall.  If that fails, it fails
      the registration, and thus the transport creation.  This let's the
      kernel detect if user space is able to support IPv6 RPC services, and
      thus whether it should maintain a PF_INET6 listener for each service
      at all.
      
      This provides complete backwards compatibilty with legacy user space
      that only supports rpcbind v2.  The only down-side is that registering
      a new kernel RPC service may take an extra exchange with the local
      portmapper on legacy systems, but this is an infrequent operation and
      is done over UDP (no lingering sockets in TIMEWAIT), so it shouldn't
      be consequential.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      cadc0fa5
    • C
      SUNRPC: Simplify svc_unregister() · d5a8620f
      Chuck Lever 提交于
      Our initial implementation of svc_unregister() assumed that PMAP_UNSET
      cleared all rpcbind registrations for a [program, version] tuple.
      However, we now have evidence that PMAP_UNSET clears only "inet"
      entries, and not "inet6" entries, in the rpcbind database.
      
      For backwards compatibility with the legacy portmapper, the
      svc_unregister() function also must work if user space doesn't support
      rpcbind version 4 at all.
      
      Thus we'll send an rpcbind v4 UNSET, and if that fails, we'll send a
      PMAP_UNSET.
      
      This simplifies the code in svc_unregister() and provides better
      backwards compatibility with legacy user space that does not support
      rpcbind version 4.  We can get rid of the conditional compilation in
      here as well.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d5a8620f
    • C
      SUNRPC: Don't return EPROTONOSUPPORT in svc_register()'s helpers · ba5c35e0
      Chuck Lever 提交于
      The RPC client returns -EPROTONOSUPPORT if there is a protocol version
      mismatch (ie the remote RPC server doesn't support the RPC protocol
      version sent by the client).
      
      Helpers for the svc_register() function return -EPROTONOSUPPORT if they
      don't recognize the passed-in IPPROTO_ value.
      
      These are two entirely different failure modes.
      
      Have the helpers return -ENOPROTOOPT instead of -EPROTONOSUPPORT.  This
      will allow callers to determine more precisely what the underlying
      problem is, and decide to report or recover appropriately.
      
      This patch is part of a series that addresses
         http://bugzilla.kernel.org/show_bug.cgi?id=12256Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ba5c35e0
    • C
      SUNRPC: Remove @family argument from svc_create() and svc_create_pooled() · 49a9072f
      Chuck Lever 提交于
      Since an RPC service listener's protocol family is specified now via
      svc_create_xprt(), it no longer needs to be passed to svc_create() or
      svc_create_pooled().  Remove that argument from the synopsis of those
      functions, and remove the sv_family field from the svc_serv struct.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      49a9072f
    • C
      SUNRPC: Pass a family argument to svc_register() · 4b62e58c
      Chuck Lever 提交于
      The sv_family field is going away.  Instead of using sv_family, have
      the svc_register() function take a protocol family argument.
      
      Since this argument represents a protocol family, and not an address
      family, this argument takes an int, as this is what is passed to
      sock_create_kern().  Also make sure svc_register's helpers are
      checking for PF_FOO instead of AF_FOO.  The value of [AP]F_FOO are
      equivalent; this is simply a symbolic change to reflect the semantics
      of the value stored in that variable.
      
      sock_create_kern() should return EPFNOSUPPORT if the passed-in
      protocol family isn't supported, but it uses EAFNOSUPPORT for this
      case.  We will stick with that tradition here, as svc_register()
      is called by the RPC server in the same path as sock_create_kern().
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4b62e58c
  18. 28 3月, 2009 1 次提交
  19. 13 3月, 2009 1 次提交
  20. 08 1月, 2009 1 次提交
  21. 30 9月, 2008 6 次提交
    • C
      SUNRPC: Fix up svc_unregister() · f6fb3f6f
      Chuck Lever 提交于
      With the new rpcbind code, a PMAP_UNSET will not have any effect on
      services registered via rpcbind v3 or v4.
      
      Implement a version of svc_unregister() that uses an RPCB_UNSET with
      an empty netid string to make sure we have cleared *all* entries for
      a kernel RPC service when shutting down, or before starting a fresh
      instance of the service.
      
      Use the new version only when CONFIG_SUNRPC_REGISTER_V4 is enabled;
      otherwise, the legacy PMAP version is used to ensure complete
      backwards-compatibility with the Linux portmapper daemon.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      f6fb3f6f
    • C
      SUNRPC: Register both netids for AF_INET6 servers · 2c7eb0b2
      Chuck Lever 提交于
      TI-RPC is a user-space library of RPC functions that replaces ONC RPC
      and allows RPC to operate in the new world of IPv6.
      
      TI-RPC combines the concept of a transport protocol (UDP and TCP)
      and a protocol family (PF_INET and PF_INET6) into a single identifier
      called a "netid."  For example, "udp" means UDP over IPv4, and "udp6"
      means UDP over IPv6.
      
      For rpcbind, then, the RPC service tuple that is registered and
      advertised is:
      
        [RPC program, RPC version, service address and port, netid]
      
      instead of
      
        [RPC program, RPC version, port, protocol]
      
      Service address is typically ANYADDR, but can be a specific address
      of one of the interfaces on a multi-homed host.  The third item in
      the new tuple is expressed as a universal address.
      
      The current Linux rpcbind implementation registers a netid for both
      protocol families when RPCB_SET is done for just the PF_INET6 version
      of the netid (ie udp6 or tcp6).  So registering "udp6" causes a
      registration for "udp" to appear automatically as well.
      
      We've recently determined that this is incorrect behavior.  In the
      TI-RPC world, "udp6" is not meant to imply that the registered RPC
      service handles requests from AF_INET as well, even if the listener
      socket does address mapping.  "udp" and "udp6" are entirely separate
      capabilities, and must be registered separately.
      
      The Linux kernel, unlike TI-RPC, leverages address mapping to allow a
      single listener socket to handle requests for both AF_INET and AF_INET6.
      This is still OK, but the kernel currently assumes registering "udp6"
      will cover "udp" as well.  It registers only "udp6" for it's AF_INET6
      services, even though they handle both AF_INET and AF_INET6 on the same
      port.
      
      So svc_register() actually needs to register both "udp" and "udp6"
      explicitly (and likewise for TCP).  Until rpcbind is fixed, the
      kernel can ignore the return code for the second RPCB_SET call.
      
      Please merge this with commit 15231312:
      
          SUNRPC: Support IPv6 when registering kernel RPC services
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: Olaf Kirch <okir@suse.de>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2c7eb0b2
    • C
      SUNRPC: Support IPv6 when registering kernel RPC services · a26cfad6
      Chuck Lever 提交于
      In order to advertise NFS-related services on IPv6 interfaces via
      rpcbind, the kernel RPC server implementation must use
      rpcb_v4_register() instead of rpcb_register().
      
      A new kernel build option allows distributions to use the legacy
      v2 call until they integrate an appropriate user-space rpcbind
      daemon that can support IPv6 RPC services.
      
      I tried adding some automatic logic to fall back if registering
      with a v4 protocol request failed, but there are too many corner
      cases.  So I just made it a compile-time switch that distributions
      can throw when they've replaced portmapper with rpcbind.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a26cfad6
    • C
      SUNRPC: Split portmap unregister API into separate function · 7252d575
      Chuck Lever 提交于
      Create a separate server-level interface for unregistering RPC services.
      
      The mechanics of, and the API for, registering and unregistering RPC
      services will diverge further as support for IPv6 is added.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7252d575
    • C
      SUNRPC: Simplify rpcb_register() API · 14aeb211
      Chuck Lever 提交于
      Bruce suggested there's no need to expose the difference between an error
      sending the PMAP_SET request and an error reply from the portmapper to
      rpcb_register's callers.  The user space equivalent of rpcb_register() is
      pmap_set(3), which returns a bool_t : either the PMAP set worked, or it
      didn't.  Simple.
      
      So let's remove the "*okay" argument from rpcb_register() and
      rpcb_v4_register(), and simply return an error if any part of the call
      didn't work.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      14aeb211
    • C
      SUNRPC: Add address family field to svc_serv data structure · e851db5b
      Chuck Lever 提交于
      Introduce and initialize an address family field in the svc_serv structure.
      
      This field will determine what family to use for the service's listener
      sockets and what families are advertised via the local rpcbind daemon.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      e851db5b