1. 08 1月, 2009 1 次提交
  2. 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
  3. 26 7月, 2008 1 次提交
  4. 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
  5. 24 6月, 2008 3 次提交
  6. 24 5月, 2008 1 次提交
  7. 09 5月, 2008 1 次提交
  8. 24 4月, 2008 5 次提交
  9. 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
  10. 02 2月, 2008 6 次提交
  11. 30 1月, 2008 1 次提交
  12. 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
  13. 10 7月, 2007 1 次提交
  14. 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
  15. 01 5月, 2007 1 次提交
  16. 07 3月, 2007 2 次提交
  17. 21 2月, 2007 2 次提交
  18. 11 2月, 2007 1 次提交
  19. 10 2月, 2007 1 次提交
    • N
      [PATCH] knfsd: fix a race in closing NFSd connections · aaf68cfb
      NeilBrown 提交于
      If you lose this race, it can iput a socket inode twice and you get a BUG
      in fs/inode.c
      
      When I added the option for user-space to close a socket, I added some
      cruft to svc_delete_socket so that I could call that function when closing
      a socket per user-space request.
      
      This was the wrong thing to do.  I should have just set SK_CLOSE and let
      normal mechanisms do the work.
      
      Not only wrong, but buggy.  The locking is all wrong and it openned up a
      race where-by a socket could be closed twice.
      
      So this patch:
        Introduces svc_close_socket which sets SK_CLOSE then either leave
        the close up to a thread, or calls svc_delete_socket if it can
        get SK_BUSY.
      
        Adds a bias to sk_busy which is removed when SK_DEAD is set,
        This avoid races around shutting down the socket.
      
        Changes several 'spin_lock' to 'spin_lock_bh' where the _bh
        was missing.
      
      Bugzilla-url: http://bugzilla.kernel.org/show_bug.cgi?id=7916Signed-off-by: NNeil Brown <neilb@suse.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aaf68cfb
  20. 04 2月, 2007 1 次提交
  21. 31 1月, 2007 1 次提交
  22. 27 1月, 2007 1 次提交