1. 10 8月, 2009 6 次提交
  2. 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: Allow callers to pass rpcb_v4_register a NULL address · 1673d0de
      Chuck Lever 提交于
      The user space TI-RPC library uses an empty string for the universal
      address when unregistering all target addresses for [program, version].
      The kernel's rpcb client should behave the same way.
      
      Here, we are switching between several registration methods based on
      the protocol family of the incoming address.  Rename the other rpcbind
      v4 registration functions to make it clear that they, as well, are
      switched on protocol family.  In /etc/netconfig, this is either "inet"
      or "inet6".
      
      NB: The loopback protocol families are not supported in the kernel.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1673d0de
    • C
      SUNRPC: rpcbind actually interprets r_owner string · 126e4bc3
      Chuck Lever 提交于
      RFC 1833 has little to say about the contents of r_owner; it only
      specifies that it is a string, and states that it is used to control
      who can UNSET an entry.
      
      Our port of rpcbind (from Sun) assumes this string contains a numeric
      UID value, not alphabetical or symbolic characters, but checks this
      value only for AF_LOCAL RPCB_SET or RPCB_UNSET requests.  In all other
      cases, rpcbind ignores the contents of the r_owner string.
      
      The reference user space implementation of rpcb_set(3) uses a numeric
      UID for all SET/UNSET requests (even via the network) and an empty
      string for all other requests.  We emulate that behavior here to
      maintain bug-for-bug compatibility.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      126e4bc3
    • C
      SUNRPC: Clean up address type casts in rpcb_v4_register() · 3aba4553
      Chuck Lever 提交于
      Clean up: Simplify rpcb_v4_register() and its helpers by moving the
      details of sockaddr type casting to rpcb_v4_register()'s helper
      functions.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      3aba4553
    • C
      SUNRPC: Use IPv4 loopback for registering AF_INET6 kernel RPC services · fc28decd
      Chuck Lever 提交于
      The kernel uses an IPv6 loopback address when registering its AF_INET6
      RPC services so that it can tell whether the local portmapper is
      actually IPv6-enabled.
      
      Since the legacy portmapper doesn't listen on IPv6, however, this
      causes a long timeout on older systems if the kernel happens to try
      creating and registering an AF_INET6 RPC service.  Originally I wanted
      to use a connected transport (either TCP or connected UDP) so that the
      upcall would fail immediately if the portmapper wasn't listening on
      IPv6, but we never agreed on what transport to use.
      
      In the end, it's of little consequence to the kernel whether the local
      portmapper is listening on IPv6.  It's only important whether the
      portmapper supports rpcbind v4.  And the kernel can't tell that at all
      if it is sending requests via IPv6 -- the portmapper will just ignore
      them.
      
      So, send both rpcbind v2 and v4 SET/UNSET requests via IPv4 loopback
      to maintain better backwards compatibility between new kernels and
      legacy user space, and prevent multi-second hangs in some cases when
      the kernel attempts to register RPC services.
      
      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>
      fc28decd
    • C
      SUNRPC: Don't flag empty RPCB_GETADDR reply as bogus · 776bd5c7
      Chuck Lever 提交于
      In 2007, commit e65fe397 added
      additional sanity checking to rpcb_decode_getaddr() to make sure we
      were getting a reply that was long enough to be an actual universal
      address.  If the uaddr string isn't long enough, the XDR decoder
      returns EIO.
      
      However, an empty string is a valid RPCB_GETADDR response if the
      requested service isn't registered.  Moreover, "::.n.m" is also a
      valid RPCB_GETADDR response for IPv6 addresses that is shorter
      than rpcb_decode_getaddr()'s lower limit of 11.  So this sanity
      check introduced a regression for rpcbind requests against IPv6
      remotes.
      
      So revert the lower bound check added by commit
      e65fe397, and add an explicit check
      for an empty uaddr string, similar to libtirpc's rpcb_getaddr(3).
      Pointed-out-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      776bd5c7
  3. 31 10月, 2008 1 次提交
  4. 30 10月, 2008 1 次提交
  5. 29 10月, 2008 1 次提交
  6. 08 10月, 2008 2 次提交
  7. 30 9月, 2008 3 次提交
    • C
      SUNRPC: Clean up debug messages in rpcb_clnt.c · db820d63
      Chuck Lever 提交于
      The RPCB XDR functions are used for multiple procedures.  For instance,
      rpcb_encode_getaddr() is used for RPCB_GETADDR, RPCB_SET, and
      RPCB_UNSET.  Make the XDR debug messages more generic so they are less
      confusing.
      
      And, unlike in other RPC consumers in the kernel, a single debug flag
      enables all levels of debug messages in the RPC bind client, including
      XDR debug messages.  Since the XDR decoders already report success or
      failure in this case, remove redundant debug messages in the mid-level
      rpcb_register_call() function.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      db820d63
    • C
      SUNRPC: Use short-hand IPv6 ANYADDR for RPCB_SET · 9d548b9c
      Chuck Lever 提交于
      Clean up: When doing an RPCB_SET, make the kernel's rpcb client use the
      shorthand "::" for the universal form of the IPv6 ANY address.
      
      Without this patch, rpcbind will advertise:
      
        0000:0000:0000:0000:0000:0000:0000:0000.x.y
      
      This is cosmetic only.  It cleans up the display of information from
      /sbin/rpcinfo.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      9d548b9c
    • 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
  8. 16 7月, 2008 5 次提交
  9. 10 7月, 2008 6 次提交
  10. 09 7月, 2008 2 次提交
  11. 06 3月, 2008 1 次提交
  12. 26 2月, 2008 1 次提交
    • T
      SUNRPC: Run rpc timeout functions as callbacks instead of in softirqs · 5d00837b
      Trond Myklebust 提交于
      An audit of the current RPC timeout functions shows that they don't really
      ever need to run in the softirq context. As long as the softirq is
      able to signal that the wakeup is due to a timeout (which it can do by
      setting task->tk_status to -ETIMEDOUT) then the callback functions can just
      run as standard task->tk_callback functions (in the rpciod/process
      context).
      
      The only possible border-line case would be xprt_timer() for the case of
      UDP, when the callback is used to reduce the size of the transport
      congestion window. In testing, however, the effect of moving that update
      to a callback would appear to be minor.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5d00837b
  13. 30 1月, 2008 5 次提交