1. 08 5月, 2013 5 次提交
    • A
      rbd: don't print warning if not mapping a parent · c734b796
      Alex Elder 提交于
      The presence of the LAYERING bit in an rbd image's feature mask does
      not guarantee the image actually has a parent image.  Currently that
      bit is set only when a clone (i.e., image with a parent) is created,
      but it is (currently) not cleared if that clone gets flattened back
      into a "normal" image.  A "parent_id" query will leave the
      parent_spec for the image being mapped a null pointer, but will not
      return an error.
      
      Currently, whenever an image with the LAYERED feature gets mapped, a
      warning about the use of layered images gets printed.  But we don't
      want to do this for a flattened image, so print the warning only
      if we find there is a parent spec after the probe.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      c734b796
    • A
      rbd: kill rbd_update_mapping_size() · 29334ba4
      Alex Elder 提交于
      Since rbd_update_mapping_size() is now a trivial wrapper, just open
      code it in its two callers.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      29334ba4
    • A
      rbd: update capacity in rbd_dev_refresh() · 00a653e2
      Alex Elder 提交于
      When a mapped image changes size, we change the capacity recorded
      for the Linux disk associated with it, in rbd_update_mapping_size().
      That function is called in two places--the format 1 and format 2
      refresh routines.
      
      There is no need to set the capacity while holding the header
      semaphore.  Instead, do it in the common rbd_dev_refresh(), using
      the logic that's already there to initiate disk revalidation.
      
      Add handling in the request function, just in case a request
      that exceeds the capacity of the device comes in (perhaps one
      that was started before a refresh shrunk the device).
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      00a653e2
    • A
      rbd: revalidate only for mapping size changes · e627db08
      Alex Elder 提交于
      This commit:
          d98df63e rbd: revalidate_disk upon rbd resize
      instituted a call to revalidate_disk() to notify interested parties
      that a mapped image has changed size.  This works well, as long as
      the the rbd device doesn't map a snapshot.
      
      A snapshot will never change size.  However, the base image the
      snapshot is associated with can, and it can do so while the snapshot
      is mapped.
      
      The problem is that the test for the size is looking at the size of
      the base image, not the size of the mapped snapshot.  This patch
      corrects that.
      
      Update the warning message shown in the event of error, and move
      it into the callers.
      
      This resolves:
          http://tracker.ceph.com/issues/4911Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      e627db08
    • A
      rbd: fix leak of format 2 snapshot context · 49ece554
      Alex Elder 提交于
      When rbd_dev_v2_refresh() is called, the rbd device already has a
      snapshot context associated with it.  But that never gets freed,
      the pointer just gets overwritten.
      
      Fix this by dropping the rbd device's reference to the snapshot
      context before overwriting the pointer.
      
      Because ceph_put_snap_context() already handles for a null pointer
      we don't need to check for that (for the probe case, where no
      context has yet been assigned).
      
      This resolves:
          http://tracker.ceph.com/issues/4912Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      49ece554
  2. 03 5月, 2013 7 次提交
  3. 02 5月, 2013 28 次提交