1. 14 10月, 2008 1 次提交
  2. 11 10月, 2008 16 次提交
  3. 08 10月, 2008 4 次提交
    • C
      sunrpc: fix oops in rpc_create when the mount namespace is unshared · 63ffc23d
      Cedric Le Goater 提交于
      On a system with nfs mounts, if a task unshares its mount namespace,
      a oops can occur when the system is rebooted if the task is the last
      to unreference the nfs mount. It will try to create a rpc request
      using utsname() which has been invalidated by free_nsproxy().
      
      The patch fixes the issue by using the global init_utsname() which is
      always valid. the capability of identifying rpc clients per uts namespace
      stills needs some extra work so this should not be a problem.
      
      BUG: unable to handle kernel NULL pointer dereference at 00000004
      IP: [<c024c9ab>] rpc_create+0x332/0x42f
      Oops: 0000 [#1] DEBUG_PAGEALLOC
      
      Pid: 1857, comm: uts-oops Not tainted (2.6.27-rc5-00319-g7686ad56 #4)
      EIP: 0060:[<c024c9ab>] EFLAGS: 00210287 CPU: 0
      EIP is at rpc_create+0x332/0x42f
      EAX: 00000000 EBX: df26adf0 ECX: c0251887 EDX: 00000001
      ESI: df26ae58 EDI: c02f293c EBP: dda0fc9c ESP: dda0fc2c
       DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
      Process uts-oops (pid: 1857, ti=dda0e000 task=dd9a0778 task.ti=dda0e000)
      Stack: c0104532 dda0fffc dda0fcac dda0e000 dda0e000 dd93b7f0 00000009 c02f2880
             df26aefc dda0fc68 c01096b7 00000000 c0266ee0 c039a070 c039a070 dda0fc74
             c012ca67 c039a064 dda0fc8c c012cb20 c03daf74 00000011 00000000 c0275c90
      Call Trace:
       [<c0104532>] ? dump_trace+0xc2/0xe2
       [<c01096b7>] ? save_stack_trace+0x1c/0x3a
       [<c012ca67>] ? save_trace+0x37/0x8c
       [<c012cb20>] ? add_lock_to_list+0x64/0x96
       [<c0256fc4>] ? rpcb_register_call+0x62/0xbb
       [<c02570c8>] ? rpcb_register+0xab/0xb3
       [<c0252f4d>] ? svc_register+0xb4/0x128
       [<c0253114>] ? svc_destroy+0xec/0x103
       [<c02531b2>] ? svc_exit_thread+0x87/0x8d
       [<c01a75cd>] ? lockd_down+0x61/0x81
       [<c01a577b>] ? nlmclnt_done+0xd/0xf
       [<c01941fe>] ? nfs_destroy_server+0x14/0x16
       [<c0194328>] ? nfs_free_server+0x4c/0xaa
       [<c019a066>] ? nfs_kill_super+0x23/0x27
       [<c0158585>] ? deactivate_super+0x3f/0x51
       [<c01695d1>] ? mntput_no_expire+0x95/0xb4
       [<c016965b>] ? release_mounts+0x6b/0x7a
       [<c01696cc>] ? __put_mnt_ns+0x62/0x70
       [<c0127501>] ? free_nsproxy+0x25/0x80
       [<c012759a>] ? switch_task_namespaces+0x3e/0x43
       [<c01275a9>] ? exit_task_namespaces+0xa/0xc
       [<c0117fed>] ? do_exit+0x4fd/0x666
       [<c01181b3>] ? do_group_exit+0x5d/0x83
       [<c011fa8c>] ? get_signal_to_deliver+0x2c8/0x2e0
       [<c0102630>] ? do_notify_resume+0x69/0x700
       [<c011d85a>] ? do_sigaction+0x134/0x145
       [<c0127205>] ? hrtimer_nanosleep+0x8f/0xce
       [<c0126d1a>] ? hrtimer_wakeup+0x0/0x1c
       [<c0103488>] ? work_notifysig+0x13/0x1b
       =======================
      Code: 70 20 68 cb c1 2c c0 e8 75 4e 01 00 8b 83 ac 00 00 00 59 3d 00 f0 ff ff 5f 77 63 eb 57 a1 00 80 2d c0 8b 80 a8 02 00 00 8d 73 68 <8b> 40 04 83 c0 45 e8 41 46 f7 ff ba 20 00 00 00 83 f8 21 0f 4c
      EIP: [<c024c9ab>] rpc_create+0x332/0x42f SS:ESP 0068:dda0fc2c
      Signed-off-by: NCedric Le Goater <clg@fr.ibm.com>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: "Serge E. Hallyn" <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      63ffc23d
    • T
      96165e2b
    • T
      SUNRPC: Fix autobind on cloned rpc clients · 9a4bd29f
      Trond Myklebust 提交于
      Despite the fact that cloned rpc clients won't have the cl_autobind flag
      set, they may still find themselves calling rpcb_getport_async(). For this
      to happen, it suffices for a _parent_ rpc_clnt to use autobinding, in which
      case any clone may find itself triggering the !xprt_bound() case in
      call_bind().
      
      The correct fix for this is to walk back up the tree of cloned rpc clients,
      in order to find the parent that 'owns' the transport, either because it
      has clnt->cl_autobind set, or because it originally created the
      transport...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      9a4bd29f
    • D
      sunrpc: do not pin sunrpc module in the memory · c9f6cde6
      Denis V. Lunev 提交于
      Basically, try_module_get here are pretty useless. Any other module using
      this API will pin sunrpc in memory due using exported symbols.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c9f6cde6
  4. 07 10月, 2008 9 次提交
  5. 05 10月, 2008 1 次提交
  6. 30 9月, 2008 9 次提交
    • B
      nfsd: use nfs client rpc callback program · d5b337b4
      Benny Halevy 提交于
      since commit ff7d9756
      "nfsd: use static memory for callback program and stats"
      do_probe_callback uses a static callback program
      (NFS4_CALLBACK) rather than the one set in clp->cl_callback.cb_prog
      as passed in by the client in setclientid (4.0)
      or create_session (4.1).
      
      This patches introduces rpc_create_args.prognumber that allows
      overriding program->number when creating rpc_clnt.
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      d5b337b4
    • 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: 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: 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: 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: Set V6ONLY socket option for RPC listener sockets · b6632339
      Chuck Lever 提交于
      My plan is to use an AF_INET listener on systems that support only IPv4,
      and an AF_INET6 listener on systems that can support IPv6. Incoming
      IPv4 packets will be posted to an AF_INET6 listener with a mapped IPv4
      address.
      
      Max Matveev <makc@sgi.com> says:
        Creating a single listener can be dangerous - if net.ipv6.bindv6only
        is enabled then it's possible to create another listener in v4
        namespace on the same port and steal the traffic from the "unifed"
        listener. You need to disable V6ONLY explicitly via a sockopt to stop
        that.
      
      Set appropriate socket option on RPC server listener sockets to prevent
      this.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      b6632339