1. 01 2月, 2013 2 次提交
  2. 16 12月, 2012 2 次提交
  3. 05 11月, 2012 2 次提交
  4. 24 10月, 2012 4 次提交
  5. 29 9月, 2012 1 次提交
  6. 25 9月, 2012 1 次提交
    • B
      SUNRPC: Set alloc_slot for backchannel tcp ops · 84e28a30
      Bryan Schumaker 提交于
      f39c1bfb (SUNRPC: Fix a UDP transport
      regression) introduced the "alloc_slot" function for xprt operations,
      but never created one for the backchannel operations.  This patch fixes
      a null pointer dereference when mounting NFS over v4.1.
      
      Call Trace:
       [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
       [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
       [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
       [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
       [<ffffffff81073589>] process_one_work+0x139/0x500
       [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
       [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
       [<ffffffff81073d1e>] worker_thread+0x15e/0x460
       [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
       [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
       [<ffffffff81079603>] kthread+0x93/0xa0
       [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
       [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
       [<ffffffff81465d00>] ? gs_change+0x13/0x13
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      84e28a30
  7. 20 9月, 2012 1 次提交
  8. 07 9月, 2012 1 次提交
    • T
      SUNRPC: Fix a UDP transport regression · f39c1bfb
      Trond Myklebust 提交于
      Commit 43cedbf0 (SUNRPC: Ensure that
      we grab the XPRT_LOCK before calling xprt_alloc_slot) is causing
      hangs in the case of NFS over UDP mounts.
      
      Since neither the UDP or the RDMA transport mechanism use dynamic slot
      allocation, we can skip grabbing the socket lock for those transports.
      Add a new rpc_xprt_op to allow switching between the TCP and UDP/RDMA
      case.
      
      Note that the NFSv4.1 back channel assigns the slot directly
      through rpc_run_bc_task, so we can ignore that case.
      Reported-by: NDick Streefland <dick.streefland@altium.nl>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@vger.kernel.org [>= 3.1]
      f39c1bfb
  9. 01 8月, 2012 1 次提交
    • M
      nfs: enable swap on NFS · a564b8f0
      Mel Gorman 提交于
      Implement the new swapfile a_ops for NFS and hook up ->direct_IO.  This
      will set the NFS socket to SOCK_MEMALLOC and run socket reconnect under
      PF_MEMALLOC as well as reset SOCK_MEMALLOC before engaging the protocol
      ->connect() method.
      
      PF_MEMALLOC should allow the allocation of struct socket and related
      objects and the early (re)setting of SOCK_MEMALLOC should allow us to
      receive the packets required for the TCP connection buildup.
      
      [jlayton@redhat.com: Restore PF_MEMALLOC task flags in all cases]
      [dfeng@redhat.com: Fix handling of multiple swap files]
      [a.p.zijlstra@chello.nl: Original patch]
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Xiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a564b8f0
  10. 31 7月, 2012 1 次提交
    • J
      nfs: skip commit in releasepage if we're freeing memory for fs-related reasons · 5cf02d09
      Jeff Layton 提交于
      We've had some reports of a deadlock where rpciod ends up with a stack
      trace like this:
      
          PID: 2507   TASK: ffff88103691ab40  CPU: 14  COMMAND: "rpciod/14"
           #0 [ffff8810343bf2f0] schedule at ffffffff814dabd9
           #1 [ffff8810343bf3b8] nfs_wait_bit_killable at ffffffffa038fc04 [nfs]
           #2 [ffff8810343bf3c8] __wait_on_bit at ffffffff814dbc2f
           #3 [ffff8810343bf418] out_of_line_wait_on_bit at ffffffff814dbcd8
           #4 [ffff8810343bf488] nfs_commit_inode at ffffffffa039e0c1 [nfs]
           #5 [ffff8810343bf4f8] nfs_release_page at ffffffffa038bef6 [nfs]
           #6 [ffff8810343bf528] try_to_release_page at ffffffff8110c670
           #7 [ffff8810343bf538] shrink_page_list.clone.0 at ffffffff81126271
           #8 [ffff8810343bf668] shrink_inactive_list at ffffffff81126638
           #9 [ffff8810343bf818] shrink_zone at ffffffff8112788f
          #10 [ffff8810343bf8c8] do_try_to_free_pages at ffffffff81127b1e
          #11 [ffff8810343bf958] try_to_free_pages at ffffffff8112812f
          #12 [ffff8810343bfa08] __alloc_pages_nodemask at ffffffff8111fdad
          #13 [ffff8810343bfb28] kmem_getpages at ffffffff81159942
          #14 [ffff8810343bfb58] fallback_alloc at ffffffff8115a55a
          #15 [ffff8810343bfbd8] ____cache_alloc_node at ffffffff8115a2d9
          #16 [ffff8810343bfc38] kmem_cache_alloc at ffffffff8115b09b
          #17 [ffff8810343bfc78] sk_prot_alloc at ffffffff81411808
          #18 [ffff8810343bfcb8] sk_alloc at ffffffff8141197c
          #19 [ffff8810343bfce8] inet_create at ffffffff81483ba6
          #20 [ffff8810343bfd38] __sock_create at ffffffff8140b4a7
          #21 [ffff8810343bfd98] xs_create_sock at ffffffffa01f649b [sunrpc]
          #22 [ffff8810343bfdd8] xs_tcp_setup_socket at ffffffffa01f6965 [sunrpc]
          #23 [ffff8810343bfe38] worker_thread at ffffffff810887d0
          #24 [ffff8810343bfee8] kthread at ffffffff8108dd96
          #25 [ffff8810343bff48] kernel_thread at ffffffff8100c1ca
      
      rpciod is trying to allocate memory for a new socket to talk to the
      server. The VM ends up calling ->releasepage to get more memory, and it
      tries to do a blocking commit. That commit can't succeed however without
      a connected socket, so we deadlock.
      
      Fix this by setting PF_FSTRANS on the workqueue task prior to doing the
      socket allocation, and having nfs_release_page check for that flag when
      deciding whether to do a commit call. Also, set PF_FSTRANS
      unconditionally in rpc_async_schedule since that function can also do
      allocations sometimes.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@vger.kernel.org
      5cf02d09
  11. 05 7月, 2012 1 次提交
    • D
      sunrpc: Don't do a dst_confirm() on an input routes. · 60d354eb
      David S. Miller 提交于
      xs_udp_data_ready() is operating on received packets, and tries to
      do a dst_confirm() on the dst attached to the SKB.
      
      This isn't right, dst confirmation is for output routes, not input
      rights.  It's for resetting the timers on the nexthop neighbour entry
      for the route, indicating that we've got good evidence that we've
      successfully reached it.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60d354eb
  12. 26 3月, 2012 1 次提交
  13. 12 3月, 2012 1 次提交
    • T
      SUNRPC: Fix a few sparse warnings · 09acfea5
      Trond Myklebust 提交于
      net/sunrpc/svcsock.c:412:22: warning: incorrect type in assignment
      (different address spaces)
       - svc_partial_recvfrom now takes a struct kvec, so the variable
         save_iovbase needs to be an ordinary (void *)
      
      Make a bunch of variables in net/sunrpc/xprtsock.c static
      
      Fix a couple of "warning: symbol 'foo' was not declared. Should it be
      static?" reports.
      
      Fix a couple of conflicting function declarations.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      09acfea5
  14. 17 2月, 2012 1 次提交
    • A
      SUNRPC: add sending,pending queue and max slot to xprt stats · 15a45206
      Andy Adamson 提交于
      With static RPC slots, the xprt backlog queue stats were useful in showing
      when the transport (TCP) was starved by lack of RPC slots. The new dynamic
      RPC slot code, commit d9ba131d, always
      provides an RPC slot and so only uses the xprt backlog queue when the
      tcp_max_slot_table_entries value has been hit or when an allocation error
      occurs. All requests are now placed on the xprt sending or pending queue which
      need to be monitored for debugging.
      
      The max_slot stat shows the maximum number of dynamic RPC slots reached which is
      useful when debugging performance issues.
      
      Add the new fields at the end of the mountstats xprt stanza so that mountstats
      outputs the previous correct values and ignores the new fields. Bump
      NFS_IOSTATS_VERS.
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      15a45206
  15. 23 11月, 2011 1 次提交
  16. 11 11月, 2011 1 次提交
  17. 18 7月, 2011 2 次提交
  18. 15 7月, 2011 1 次提交
  19. 28 5月, 2011 3 次提交
    • C
      SUNRPC: Support for RPC over AF_LOCAL transports · 176e21ee
      Chuck Lever 提交于
      TI-RPC introduces the capability of performing RPC over AF_LOCAL
      sockets.  It uses this mainly for registering and unregistering
      local RPC services securely with the local rpcbind, but we could
      also conceivably use it as a generic upcall mechanism.
      
      This patch provides a client-side only implementation for the moment.
      We might also consider a server-side implementation to provide
      AF_LOCAL access to NLM (for statd downcalls, and such like).
      
      Autobinding is not supported on kernel AF_LOCAL transports at this
      time.  Kernel ULPs must specify the pathname of the remote endpoint
      when an AF_LOCAL transport is created.  rpcbind supports registering
      services available via AF_LOCAL, so the kernel could handle it with
      some adjustment to ->rpcbind and ->set_port.  But we don't need this
      feature for doing upcalls via well-known named sockets.
      
      This has not been tested with ULPs that move a substantial amount of
      data.  Thus, I can't attest to how robust the write_space and
      congestion management logic is.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      176e21ee
    • C
      SUNRPC: Rename xs_encode_tcp_fragment_header() · 61677eee
      Chuck Lever 提交于
      Clean up: Use a more generic name for xs_encode_tcp_fragment_header();
      it's appropriate to use for all stream transport types.  We're about
      to add new stream transport.
      
      Also, move it to a place where it is more easily shared amongst the
      various send_request methods.  And finally, replace the "htonl" macro
      invocation with its modern equivalent.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      61677eee
    • T
      SUNRPC: Deal with the lack of a SYN_SENT sk->sk_state_change callback... · fe19a96b
      Trond Myklebust 提交于
      The TCP connection state code depends on the state_change() callback
      being called when the SYN_SENT state is set. However the networking layer
      doesn't actually call us back in that case.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@kernel.org
      fe19a96b
  20. 31 3月, 2011 1 次提交
  21. 23 3月, 2011 1 次提交
  22. 11 3月, 2011 1 次提交
  23. 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
  24. 15 12月, 2010 1 次提交
    • T
      workqueue: convert cancel_rearming_delayed_work[queue]() users to cancel_delayed_work_sync() · afe2c511
      Tejun Heo 提交于
      cancel_rearming_delayed_work[queue]() has been superceded by
      cancel_delayed_work_sync() quite some time ago.  Convert all the
      in-kernel users.  The conversions are completely equivalent and
      trivial.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: N"David S. Miller" <davem@davemloft.net>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: netdev@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Alex Elder <aelder@sgi.com>
      Cc: xfs-masters@oss.sgi.com
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: netfilter-devel@vger.kernel.org
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: linux-nfs@vger.kernel.org
      afe2c511
  25. 21 10月, 2010 2 次提交
    • C
      SUNRPC: Properly initialize sock_xprt.srcaddr in all cases · 92476850
      Chuck Lever 提交于
      The source address field in the transport's sock_xprt is initialized
      ONLY IF the RPC application passed a pointer to a source address
      during the call to rpc_create().  However, xs_bind() subsequently uses
      the value of this field without regard to whether the source address
      was initialized during transport creation or not.
      
      So far we've been lucky: the uninitialized value of this field is
      zeroes.  xs_bind(), until recently, used only the sin[6]_addr field in
      this sockaddr, and all zeroes is a valid value for this: it means
      ANYADDR.  This is a happy coincidence.
      
      However, xs_bind() now wants to use the sa_family field as well, and
      expects it to be initialized to something other than zero.
      
      Therefore, the source address sockaddr field should be fully
      initialized at transport create time in _every_ case, not just when
      the RPC application wants to use a specific bind address.
      
      Bruce added a workaround for this missing initialization by adjusting
      commit 6bc9638a, but the "right" way to do this is to ensure that the
      source address sockaddr is always correctly initialized from the
      get-go.
      
      This patch doesn't introduce a behavior change.  It's simply a
      clean-up of Bruce's fix, to prevent future problems of this kind.  It
      may look like overkill, but
      
        a) it clearly documents the default initial value of this field,
      
        b) it doesn't assume that the sockaddr_storage memory is first
           initialized to any particular value, and
      
        c) it will fail verbosely if some unknown address family is passed
           in
      
      Originally introduced by commit d3bc9a1d.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      92476850
    • C
      SUNRPC: Use conventional switch statement when reclassifying sockets · 4232e863
      Chuck Lever 提交于
      Clean up.
      
      Defensive coding: If "family" is ever something that is neither
      AF_INET nor AF_INET6, xs_reclassify_socket6() is not the appropriate
      default action.  Choose to do nothing in that case.
      
      Introduced by commit 6bc9638a.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      4232e863
  26. 19 10月, 2010 3 次提交