1. 21 8月, 2009 1 次提交
  2. 15 8月, 2009 2 次提交
  3. 10 8月, 2009 12 次提交
  4. 13 7月, 2009 1 次提交
  5. 18 6月, 2009 10 次提交
  6. 03 5月, 2009 1 次提交
  7. 29 4月, 2009 4 次提交
    • C
      SUNRPC: pass buffer size to svc_sock_names() · 8435d34d
      Chuck Lever 提交于
      Adjust the synopsis of svc_sock_names() to pass in the size of the
      output buffer.  Add a documenting comment.
      
      This is a cosmetic change for now.  A subsequent patch will make sure
      the buffer length is passed to one_sock_name(), where the length will
      actually be useful.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      8435d34d
    • C
      SUNRPC: pass buffer size to svc_addsock() · bfba9ab4
      Chuck Lever 提交于
      Adjust the synopsis of svc_addsock() to pass in the size of the output
      buffer.  Add a documenting comment.
      
      This is a cosmetic change for now.  A subsequent patch will make sure
      the buffer length is passed to one_sock_name(), where the length will
      actually be useful.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      bfba9ab4
    • C
      NFSD: Prevent a buffer overflow in svc_xprt_names() · 335c54bd
      Chuck Lever 提交于
      The svc_xprt_names() function can overflow its buffer if it's so near
      the end of the passed in buffer that the "name too long" string still
      doesn't fit.  Of course, it could never tell if it was near the end
      of the passed in buffer, since its only caller passes in zero as the
      buffer length.
      
      Let's make this API a little safer.
      
      Change svc_xprt_names() so it *always* checks for a buffer overflow,
      and change its only caller to pass in the correct buffer length.
      
      If svc_xprt_names() does overflow its buffer, it now fails with an
      ENAMETOOLONG errno, instead of trying to write a message at the end
      of the buffer.  I don't like this much, but I can't figure out a clean
      way that's always safe to return some of the names, *and* an
      indication that the buffer was not long enough.
      
      The displayed error when doing a 'cat /proc/fs/nfsd/portlist' is
      "File name too long".
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      335c54bd
    • C
      SUNRPC: Fix error return value of svc_addr_len() · abc5c44d
      Chuck Lever 提交于
      The svc_addr_len() helper function returns -EAFNOSUPPORT if it doesn't
      recognize the address family of the passed-in socket address.  However,
      the return type of this function is size_t, which means -EAFNOSUPPORT
      is turned into a very large positive value in this case.
      
      The check in svc_udp_recvfrom() to see if the return value is less
      than zero therefore won't work at all.
      
      Additionally, handle_connect_req() passes this value directly to
      memset().  This could cause memset() to clobber a large chunk of memory
      if svc_addr_len() has returned an error.  Currently the address family
      of these addresses, however, is known to be supported long before
      handle_connect_req() is called, so this isn't a real risk.
      
      Change the error return value of svc_addr_len() to zero, which fits in
      the range of size_t, and is safer to pass to memset() directly.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      abc5c44d
  8. 04 4月, 2009 2 次提交
  9. 29 3月, 2009 5 次提交
  10. 20 3月, 2009 1 次提交
    • T
      SUNRPC: Add the equivalent of the linger and linger2 timeouts to RPC sockets · 7d1e8255
      Trond Myklebust 提交于
      This fixes a regression against FreeBSD servers as reported by Tomas
      Kasparek. Apparently when using RPC over a TCP socket, the FreeBSD servers
      don't ever react to the client closing the socket, and so commit
      e06799f9 (SUNRPC: Use shutdown() instead of
      close() when disconnecting a TCP socket) causes the setup to hang forever
      whenever the client attempts to close and then reconnect.
      
      We break the deadlock by adding a 'linger2' style timeout to the socket,
      after which, the client will abort the connection using a TCP 'RST'.
      
      The default timeout is set to 15 seconds. A subsequent patch will put it
      under user control by means of a systctl.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7d1e8255
  11. 19 3月, 2009 1 次提交