1. 08 4月, 2011 1 次提交
  2. 27 3月, 2011 1 次提交
    • O
      NFS: Ensure that rpc_release_resources_task() can be called twice. · a271c5a0
      OGAWA Hirofumi 提交于
      BUG: atomic_dec_and_test(): -1: atomic counter underflow at:
      Pid: 2827, comm: mount.nfs Not tainted 2.6.38 #1
      Call Trace:
       [<ffffffffa02223a0>] ? put_rpccred+0x44/0x14e [sunrpc]
       [<ffffffffa021bbe9>] ? rpc_ping+0x4e/0x58 [sunrpc]
       [<ffffffffa021c4a5>] ? rpc_create+0x481/0x4fc [sunrpc]
       [<ffffffffa022298a>] ? rpcauth_lookup_credcache+0xab/0x22d [sunrpc]
       [<ffffffffa028be8c>] ? nfs_create_rpc_client+0xa6/0xeb [nfs]
       [<ffffffffa028c660>] ? nfs4_set_client+0xc2/0x1f9 [nfs]
       [<ffffffffa028cd3c>] ? nfs4_create_server+0xf2/0x2a6 [nfs]
       [<ffffffffa0295d07>] ? nfs4_remote_mount+0x4e/0x14a [nfs]
       [<ffffffff810dd570>] ? vfs_kern_mount+0x6e/0x133
       [<ffffffffa029605a>] ? nfs_do_root_mount+0x76/0x95 [nfs]
       [<ffffffffa029643d>] ? nfs4_try_mount+0x56/0xaf [nfs]
       [<ffffffffa0297434>] ? nfs_get_sb+0x435/0x73c [nfs]
       [<ffffffff810dd59b>] ? vfs_kern_mount+0x99/0x133
       [<ffffffff810dd693>] ? do_kern_mount+0x48/0xd8
       [<ffffffff810f5b75>] ? do_mount+0x6da/0x741
       [<ffffffff810f5c5f>] ? sys_mount+0x83/0xc0
       [<ffffffff8100293b>] ? system_call_fastpath+0x16/0x1b
      
      Well, so, I think this is real bug of nfs codes somewhere. With some
      review, the code
      
      rpc_call_sync()
          rpc_run_task
              rpc_execute()
                  __rpc_execute()
                      rpc_release_task()
                          rpc_release_resources_task()
                              put_rpccred()                <= release cred
          rpc_put_task
              rpc_do_put_task()
                  rpc_release_resources_task()
                      put_rpccred()                        <= release cred again
      
      seems to be release cred unintendedly.
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a271c5a0
  3. 25 3月, 2011 2 次提交
  4. 23 3月, 2011 1 次提交
  5. 18 3月, 2011 5 次提交
  6. 16 3月, 2011 2 次提交
  7. 12 3月, 2011 6 次提交
  8. 11 3月, 2011 3 次提交
    • B
      sunrpc: Propagate errors from xs_bind() through xs_create_sock() · 4cea288a
      Ben Hutchings 提交于
      xs_create_sock() is supposed to return a pointer or an ERR_PTR-encoded
      error, but it currently returns 0 if xs_bind() fails.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Cc: stable@kernel.org [v2.6.37]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4cea288a
    • J
      SUNRPC: Remove resource leak in svc_rdma_send_error() · a5e50268
      Jesper Juhl 提交于
      We leak the memory allocated to 'ctxt' when we return after
      'ib_dma_mapping_error()' returns !=0.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a5e50268
    • T
      SUNRPC: Close a race in __rpc_wait_for_completion_task() · bf294b41
      Trond Myklebust 提交于
      Although they run as rpciod background tasks, under normal operation
      (i.e. no SIGKILL), functions like nfs_sillyrename(), nfs4_proc_unlck()
      and nfs4_do_close() want to be fully synchronous. This means that when we
      exit, we want all references to the rpc_task to be gone, and we want
      any dentry references etc. held by that task to be released.
      
      For this reason these functions call __rpc_wait_for_completion_task(),
      followed by rpc_put_task() in the expectation that the latter will be
      releasing the last reference to the rpc_task, and thus ensuring that the
      callback_ops->rpc_release() has been called synchronously.
      
      This patch fixes a race which exists due to the fact that
      rpciod calls rpc_complete_task() (in order to wake up the callers of
      __rpc_wait_for_completion_task()) and then subsequently calls
      rpc_put_task() without ensuring that these two steps are done atomically.
      
      In order to avoid adding new spin locks, the patch uses the existing
      waitqueue spin lock to order the rpc_task reference count releases between
      the waiting process and rpciod.
      The common case where nobody is waiting for completion is optimised for by
      checking if the RPC_TASK_ASYNC flag is cleared and/or if the rpc_task
      reference count is 1: in those cases we drop trying to grab the spin lock,
      and immediately free up the rpc_task.
      
      Those few processes that need to put the rpc_task from inside an
      asynchronous context and that do not care about ordering are given a new
      helper: rpc_put_task_async().
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      bf294b41
  9. 10 3月, 2011 1 次提交
    • J
      svcrpc: fix bad argument in unix_domain_find · 352b5d13
      J. Bruce Fields 提交于
      "After merging the nfsd tree, today's linux-next build (powerpc
      ppc64_defconfig) produced this warning:
      
      net/sunrpc/svcauth_unix.c: In function 'unix_domain_find':
      net/sunrpc/svcauth_unix.c:58: warning: passing argument 1 of
      +'svcauth_unix_domain_release' from incompatible pointer type
      net/sunrpc/svcauth_unix.c:41: note: expected 'struct auth_domain *' but
      argument
      +is of type 'struct unix_domain *'
      
      Introduced by commit 8b3e07ac ("svcrpc: fix rare race on unix_domain
      creation")."
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      352b5d13
  10. 09 3月, 2011 1 次提交
  11. 08 3月, 2011 1 次提交
  12. 23 2月, 2011 1 次提交
  13. 26 1月, 2011 1 次提交
  14. 25 1月, 2011 1 次提交
  15. 12 1月, 2011 3 次提交
    • J
      rpc: allow xprt_class->setup to return a preexisting xprt · f0418aa4
      J. Bruce Fields 提交于
      This allows us to reuse the xprt associated with a server connection if
      one has already been set up.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      f0418aa4
    • J
      rpc: keep backchannel xprt as long as server connection · 99de8ea9
      J. Bruce Fields 提交于
      Multiple backchannels can share the same tcp connection; from rfc 5661 section
      2.10.3.1:
      
      	A connection's association with a session is not exclusive.  A
      	connection associated with the channel(s) of one session may be
      	simultaneously associated with the channel(s) of other sessions
      	including sessions associated with other client IDs.
      
      However, multiple backchannels share a connection, they must all share
      the same xid stream (hence the same rpc_xprt); the only way we have to
      match replies with calls at the rpc layer is using the xid.
      
      So, keep the rpc_xprt around as long as the connection lasts, in case
      we're asked to use the connection as a backchannel again.
      
      Requests to create new backchannel clients over a given server
      connection should results in creating new clients that reuse the
      existing rpc_xprt.
      
      But to start, just reject attempts to associate multiple rpc_xprt's with
      the same underlying bc_xprt.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      99de8ea9
    • J
      rpc: move sk_bc_xprt to svc_xprt · d75faea3
      J. Bruce Fields 提交于
      This seems obviously transport-level information even if it's currently
      used only by the server socket code.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      d75faea3
  16. 11 1月, 2011 1 次提交
    • T
      NFS: Don't use vm_map_ram() in readdir · 6650239a
      Trond Myklebust 提交于
      vm_map_ram() is not available on NOMMU platforms, and causes trouble
      on incoherrent architectures such as ARM when we access the page data
      through both the direct and the virtual mapping.
      
      The alternative is to use the direct mapping to access page data
      for the case when we are not crossing a page boundary, but to copy
      the data into a linear scratch buffer when we are accessing data
      that spans page boundaries.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Tested-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      Cc: stable@kernel.org  [2.6.37]
      6650239a
  17. 07 1月, 2011 9 次提交