1. 31 7月, 2012 10 次提交
  2. 18 7月, 2012 1 次提交
    • S
      libceph: fix messenger retry · 5bdca4e0
      Sage Weil 提交于
      In ancient times, the messenger could both initiate and accept connections.
      An artifact if that was data structures to store/process an incoming
      ceph_msg_connect request and send an outgoing ceph_msg_connect_reply.
      Sadly, the negotiation code was referencing those structures and ignoring
      important information (like the peer's connect_seq) from the correct ones.
      
      Among other things, this fixes tight reconnect loops where the server sends
      RETRY_SESSION and we (the client) retries with the same connect_seq as last
      time.  This bug pretty easily triggered by injecting socket failures on the
      MDS and running some fs workload like workunits/direct_io/test_sync_io.
      Signed-off-by: NSage Weil <sage@inktank.com>
      5bdca4e0
  3. 06 7月, 2012 3 次提交
  4. 22 6月, 2012 1 次提交
  5. 06 6月, 2012 5 次提交
    • A
      libceph: make ceph_con_revoke_message() a msg op · 8921d114
      Alex Elder 提交于
      ceph_con_revoke_message() is passed both a message and a ceph
      connection.  A ceph_msg allocated for incoming messages on a
      connection always has a pointer to that connection, so there's no
      need to provide the connection when revoking such a message.
      
      Note that the existing logic does not preclude the message supplied
      being a null/bogus message pointer.  The only user of this interface
      is the OSD client, and the only value an osd client passes is a
      request's r_reply field.  That is always non-null (except briefly in
      an error path in ceph_osdc_alloc_request(), and that drops the
      only reference so the request won't ever have a reply to revoke).
      So we can safely assume the passed-in message is non-null, but add a
      BUG_ON() to make it very obvious we are imposing this restriction.
      
      Rename the function ceph_msg_revoke_incoming() to reflect that it is
      really an operation on an incoming message.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      8921d114
    • A
      libceph: make ceph_con_revoke() a msg operation · 6740a845
      Alex Elder 提交于
      ceph_con_revoke() is passed both a message and a ceph connection.
      Now that any message associated with a connection holds a pointer
      to that connection, there's no need to provide the connection when
      revoking a message.
      
      This has the added benefit of precluding the possibility of the
      providing the wrong connection pointer.  If the message's connection
      pointer is null, it is not being tracked by any connection, so
      revoking it is a no-op.  This is supported as a convenience for
      upper layers, so they can revoke a message that is not actually
      "in flight."
      
      Rename the function ceph_msg_revoke() to reflect that it is really
      an operation on a message, not a connection.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      6740a845
    • A
      libceph: have messages point to their connection · 38941f80
      Alex Elder 提交于
      When a ceph message is queued for sending it is placed on a list of
      pending messages (ceph_connection->out_queue).  When they are
      actually sent over the wire, they are moved from that list to
      another (ceph_connection->out_sent).  When acknowledgement for the
      message is received, it is removed from the sent messages list.
      
      During that entire time the message is "in the possession" of a
      single ceph connection.  Keep track of that connection in the
      message.  This will be used in the next patch (and is a helpful
      bit of information for debugging anyway).
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      38941f80
    • A
      libceph: fully initialize connection in con_init() · 1bfd89f4
      Alex Elder 提交于
      Move the initialization of a ceph connection's private pointer,
      operations vector pointer, and peer name information into
      ceph_con_init().  Rearrange the arguments so the connection pointer
      is first.  Hide the byte-swapping of the peer entity number inside
      ceph_con_init()
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      1bfd89f4
    • A
      libceph: embed ceph connection structure in mon_client · 67130934
      Alex Elder 提交于
      A monitor client has a pointer to a ceph connection structure in it.
      This is the only one of the three ceph client types that do it this
      way; the OSD and MDS clients embed the connection into their main
      structures.  There is always exactly one ceph connection for a
      monitor client, so there is no need to allocate it separate from the
      monitor client structure.
      
      So switch the ceph_mon_client structure to embed its
      ceph_connection structure.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      67130934
  6. 01 6月, 2012 5 次提交
    • A
      libceph: start tracking connection socket state · ce2c8903
      Alex Elder 提交于
      Start explicitly keeping track of the state of a ceph connection's
      socket, separate from the state of the connection itself.  Create
      placeholder functions to encapsulate the state transitions.
      
          --------
          | NEW* |  transient initial state
          --------
              | con_sock_state_init()
              v
          ----------
          | CLOSED |  initialized, but no socket (and no
          ----------  TCP connection)
           ^      \
           |       \ con_sock_state_connecting()
           |        ----------------------
           |                              \
           + con_sock_state_closed()       \
           |\                               \
           | \                               \
           |  -----------                     \
           |  | CLOSING |  socket event;       \
           |  -----------  await close          \
           |       ^                            |
           |       |                            |
           |       + con_sock_state_closing()   |
           |      / \                           |
           |     /   ---------------            |
           |    /                   \           v
           |   /                    --------------
           |  /    -----------------| CONNECTING |  socket created, TCP
           |  |   /                 --------------  connect initiated
           |  |   | con_sock_state_connected()
           |  |   v
          -------------
          | CONNECTED |  TCP connection established
          -------------
      
      Make the socket state an atomic variable, reinforcing that it's a
      distinct transtion with no possible "intermediate/both" states.
      This is almost certainly overkill at this point, though the
      transitions into CONNECTED and CLOSING state do get called via
      socket callback (the rest of the transitions occur with the
      connection mutex held).  We can back out the atomicity later.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: Sage Weil<sage@inktank.com>
      ce2c8903
    • A
      libceph: start separating connection flags from state · 928443cd
      Alex Elder 提交于
      A ceph_connection holds a mixture of connection state (as in "state
      machine" state) and connection flags in a single "state" field.  To
      make the distinction more clear, define a new "flags" field and use
      it rather than the "state" field to hold Boolean flag values.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: Sage Weil<sage@inktank.com>
      928443cd
    • A
      libceph: embed ceph messenger structure in ceph_client · 15d9882c
      Alex Elder 提交于
      A ceph client has a pointer to a ceph messenger structure in it.
      There is always exactly one ceph messenger for a ceph client, so
      there is no need to allocate it separate from the ceph client
      structure.
      
      Switch the ceph_client structure to embed its ceph_messenger
      structure.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NYehuda Sadeh <yehuda@inktank.com>
      Reviewed-by: NSage Weil <sage@inktank.com>
      15d9882c
    • A
      libceph: kill bad_proto ceph connection op · 6384bb8b
      Alex Elder 提交于
      No code sets a bad_proto method in its ceph connection operations
      vector, so just get rid of it.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NYehuda Sadeh <yehuda@inktank.com>
      6384bb8b
    • A
      libceph: eliminate connection state "DEAD" · e5e372da
      Alex Elder 提交于
      The ceph connection state "DEAD" is never set and is therefore not
      needed.  Eliminate it.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NYehuda Sadeh <yehuda@inktank.com>
      e5e372da
  7. 17 5月, 2012 4 次提交
  8. 15 5月, 2012 1 次提交
  9. 08 5月, 2012 1 次提交
  10. 22 3月, 2012 4 次提交
  11. 05 3月, 2012 1 次提交
    • P
      BUG: headers with BUG/BUG_ON etc. need linux/bug.h · 187f1882
      Paul Gortmaker 提交于
      If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
      other BUG variant in a static inline (i.e. not in a #define) then
      that header really should be including <linux/bug.h> and not just
      expecting it to be implicitly present.
      
      We can make this change risk-free, since if the files using these
      headers didn't have exposure to linux/bug.h already, they would have
      been causing compile failures/warnings.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      187f1882
  12. 12 11月, 2011 1 次提交
  13. 26 10月, 2011 2 次提交
  14. 15 9月, 2011 1 次提交
    • J
      Remove unneeded version.h includes from include/ · e81b1516
      Jesper Juhl 提交于
      It was pointed out by 'make versioncheck' that some includes of
      linux/version.h are not needed in include/.
      This patch removes them.
      
      When I last posted the patch, the ceph bit was ACK'ed by Sage Weil, so
      I've added that below.
      
      The pwc-ioctl change generated quite a bit of discussion about V4L version
      numbers in general, but as far as I can tell, no concensus was reached on
      what the long term solution should be, so in the mean time I think we
      could start by just removing the unneeded include, which is why I'm
      resending the patch with that hunk still included.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Acked-by: NSage Weil <sage@newdream.net>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e81b1516