1. 29 3月, 2009 4 次提交
    • 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
  2. 08 1月, 2009 1 次提交
  3. 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
  4. 26 7月, 2008 1 次提交
  5. 19 7月, 2008 1 次提交
    • M
      cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr · 65c01184
      Mike Travis 提交于
        * This patch replaces the dangerous lvalue version of cpumask_of_cpu
          with new cpumask_of_cpu_ptr macros.  These are patterned after the
          node_to_cpumask_ptr macros.
      
          In general terms, if there is a cpumask_of_cpu_map[] then a pointer to
          the cpumask_of_cpu_map[cpu] entry is used.  The cpumask_of_cpu_map
          is provided when there is a large NR_CPUS count, reducing
          greatly the amount of code generated and stack space used for
          cpumask_of_cpu().  The pointer to the cpumask_t value is needed for
          calling set_cpus_allowed_ptr() to reduce the amount of stack space
          needed to pass the cpumask_t value.
      
          If there isn't a cpumask_of_cpu_map[], then a temporary variable is
          declared and filled in with value from cpumask_of_cpu(cpu) as well as
          a pointer variable pointing to this temporary variable.  Afterwards,
          the pointer is used to reference the cpumask value.  The compiler
          will optimize out the extra dereference through the pointer as well
          as the stack space used for the pointer, resulting in identical code.
      
          A good example of the orthogonal usages is in net/sunrpc/svc.c:
      
      	case SVC_POOL_PERCPU:
      	{
      		unsigned int cpu = m->pool_to[pidx];
      		cpumask_of_cpu_ptr(cpumask, cpu);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, cpumask);
      		return 1;
      	}
      	case SVC_POOL_PERNODE:
      	{
      		unsigned int node = m->pool_to[pidx];
      		node_to_cpumask_ptr(nodecpumask, node);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, nodecpumask);
      		return 1;
      	}
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      65c01184
  6. 24 6月, 2008 3 次提交
  7. 24 5月, 2008 1 次提交
  8. 09 5月, 2008 1 次提交
  9. 24 4月, 2008 5 次提交
  10. 20 4月, 2008 1 次提交
    • M
      nodemask: use new node_to_cpumask_ptr function · c5f59f08
      Mike Travis 提交于
        * Use new node_to_cpumask_ptr.  This creates a pointer to the
          cpumask for a given node.  This definition is in mm patch:
      
      	asm-generic-add-node_to_cpumask_ptr-macro.patch
      
        * Use new set_cpus_allowed_ptr function.
      
      Depends on:
      	[mm-patch]: asm-generic-add-node_to_cpumask_ptr-macro.patch
      	[sched-devel]: sched: add new set_cpus_allowed_ptr function
      	[x86/latest]: x86: add cpus_scnprintf function
      
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Greg Banks <gnb@melbourne.sgi.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c5f59f08
  11. 02 2月, 2008 6 次提交
  12. 30 1月, 2008 1 次提交
  13. 10 10月, 2007 1 次提交
    • D
      knfsd: Add source address to sunrpc svc errors · 354ecbb9
      Dr. David Alan Gilbert 提交于
      This patch adds the address of the client that caused an error in
      sunrpc/svc.c so that you get errors that look like:
      
      svc: 192.168.66.28, port=709: unknown version (3 for prog 100003, nfsd)
      
      I've seen machines which get bunches of unknown version or similar
      errors from time to time, and while the recent patch to add the service
      helps to find which service has the wrong version it doesn't help find
      the potentially bad client.
      
      The patch is against a checkout of Linus's git tree made on 2007-08-24.
      
      One observation is that the svc_print_addr function prints to a buffer
      which in this case makes life a little more complex; it just feels as if
      there must be lots of places that print a connection address - is there
      a better function to use anywhere?
      
      I think actually there are a few places with semi duplicated code; e.g.
      one_sock_name switches on the address family but only currently has
      IPV4; I wonder how many other places are similar.
      Signed-off-by: NDave Gilbert <linux@treblig.org>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Acked-by: NNeil Brown <neilb@suse.de>
      354ecbb9
  14. 10 7月, 2007 1 次提交
  15. 10 5月, 2007 1 次提交
    • J
      RPC: add wrapper for svc_reserve to account for checksum · cd123012
      Jeff Layton 提交于
      When the kernel calls svc_reserve to downsize the expected size of an RPC
      reply, it fails to account for the possibility of a checksum at the end of
      the packet.  If a client mounts a NFSv2/3 with sec=krb5i/p, and does I/O
      then you'll generally see messages similar to this in the server's ring
      buffer:
      
      RPC request reserved 164 but used 208
      
      While I was never able to verify it, I suspect that this problem is also
      the root cause of some oopses I've seen under these conditions:
      
      https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227726
      
      This is probably also a problem for other sec= types and for NFSv4.  The
      large reserved size for NFSv4 compound packets seems to generally paper
      over the problem, however.
      
      This patch adds a wrapper for svc_reserve that accounts for the possibility
      of a checksum.  It also fixes up the appropriate callers of svc_reserve to
      call the wrapper.  For now, it just uses a hardcoded value that I
      determined via testing.  That value may need to be revised upward as things
      change, or we may want to eventually add a new auth_op that attempts to
      calculate this somehow.
      
      Unfortunately, there doesn't seem to be a good way to reliably determine
      the expected checksum length prior to actually calculating it, particularly
      with schemes like spkm3.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NNeil Brown <neilb@suse.de>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Acked-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd123012
  16. 01 5月, 2007 1 次提交
  17. 07 3月, 2007 2 次提交
  18. 21 2月, 2007 2 次提交
  19. 11 2月, 2007 1 次提交