1. 20 Dec, 2012 2 commits
    • Alex Elder's avatar
      libceph: init osd->o_node in create_osd() · f407731d
      Alex Elder authored
      The red-black node node in the ceph osd structure is not initialized
      in create_osd().  Because this node can be the subject of a
      RB_EMPTY_NODE() call later on, we should ensure the node is
      initialized properly for that.  Add a call to RB_CLEAR_NODE()
      initialize it.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      f407731d
    • Alex Elder's avatar
      libceph: report connection fault with warning · 28362986
      Alex Elder authored
      When a connection's socket disconnects, or if there's a protocol
      error of some kind on the connection, a fault is signaled and
      the connection is reset (closed and reopened, basically).  We
      currently get an error message on the log whenever this occurs.
      
      A ceph connection will attempt to reestablish a socket connection
      repeatedly if a fault occurs.  This means that these error messages
      will get repeatedly added to the log, which is undesirable.
      
      Change the error message to be a warning, so they don't get
      logged by default.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      28362986
  2. 17 Dec, 2012 7 commits
    • Alex Elder's avatar
      libceph: socket can close in any connection state · 7bb21d68
      Alex Elder authored
      A connection's socket can close for any reason, independent of the
      state of the connection (and without irrespective of the connection
      mutex).  As a result, the connectino can be in pretty much any state
      at the time its socket is closed.
      
      Handle those other cases at the top of con_work().  Pull this whole
      block of code into a separate function to reduce the clutter.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      7bb21d68
    • Alex Elder's avatar
      rbd: don't use ENOTSUPP · b8f5c6ed
      Alex Elder authored
      ENOTSUPP is not a standard errno (it shows up as "Unknown error 524"
      in an error message).  This is what was getting produced when the
      the local rbd code does not implement features required by a
      discovered rbd image.
      
      Change the error code returned in this case to ENXIO.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      b8f5c6ed
    • Alex Elder's avatar
      rbd: remove linger unconditionally · 61c74035
      Alex Elder authored
      In __unregister_linger_request(), the request is being removed
      from the osd client's req_linger list only when the request
      has a non-null osd pointer.  It should be done whether or not
      the request currently has an osd.
      
      This is most likely a non-issue because I believe the request
      will always have an osd when this function is called.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      61c74035
    • Alex Elder's avatar
      rbd: get rid of RBD_MAX_SEG_NAME_LEN · 2fd82b9e
      Alex Elder authored
      RBD_MAX_SEG_NAME_LEN represents the maximum length of an rbd object
      name (i.e., one of the objects providing storage backing an rbd
      image).
      
      Another symbol, MAX_OBJ_NAME_SIZE, is used in the osd client code to
      define the maximum length of any object name in an osd request.
      
      Right now they disagree, with RBD_MAX_SEG_NAME_LEN being too big.
      
      There's no real benefit at this point to defining the rbd object
      name length limit separate from any other object name, so just
      get rid of RBD_MAX_SEG_NAME_LEN and use MAX_OBJ_NAME_SIZE in its
      place.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      2fd82b9e
    • Alex Elder's avatar
      libceph: avoid using freed osd in __kick_osd_requests() · 685a7555
      Alex Elder authored
      If an osd has no requests and no linger requests, __reset_osd()
      will just remove it with a call to __remove_osd().  That drops
      a reference to the osd, and therefore the osd may have been free
      by the time __reset_osd() returns.  That function offers no
      indication this may have occurred, and as a result the osd will
      continue to be used even when it's no longer valid.
      
      Change__reset_osd() so it returns an error (ENODEV) when it
      deletes the osd being reset.  And change __kick_osd_requests() so it
      returns immediately (before referencing osd again) if __reset_osd()
      returns *any* error.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      685a7555
    • Alex Elder's avatar
      ceph: don't reference req after put · 7d5f2481
      Alex Elder authored
      In __unregister_request(), there is a call to list_del_init()
      referencing a request that was the subject of a call to
      ceph_osdc_put_request() on the previous line.  This is not
      safe, because the request structure could have been freed
      by the time we reach the list_del_init().
      
      Fix this by reversing the order of these lines.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-off-by: default avatarSage Weil <sage@inktank.com>
      7d5f2481
    • Alex Elder's avatar
      rbd: do not allow remove of mounted-on image · 42382b70
      Alex Elder authored
      There is no check in rbd_remove() to see if anybody holds open the
      image being removed.  That's not cool.
      
      Add a simple open count that goes up and down with opens and closes
      (releases) of the device, and don't allow an rbd image to be removed
      if the count is non-zero.
      
      Protect the updates of the open count value with ctl_mutex to ensure
      the underlying rbd device doesn't get removed while concurrently
      being opened.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      42382b70
  3. 13 Dec, 2012 9 commits
  4. 05 Nov, 2012 1 commit
    • Sage Weil's avatar
      ceph: Fix i_size update race · 22cddde1
      Sage Weil authored
      ceph_aio_write() has an optimization that marks cap EPH_CAP_FILE_WR
      dirty before data is copied to page cache and inode size is updated.
      If ceph_check_caps() flushes the dirty cap before the inode size is
      updated, MDS can miss the new inode size. The fix is move
      ceph_{get,put}_cap_refs() into ceph_write_{begin,end}() and call
      __ceph_mark_dirty_caps() after inode size is updated.
      Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      22cddde1
  5. 04 Nov, 2012 1 commit
  6. 01 Nov, 2012 11 commits
  7. 30 Oct, 2012 9 commits