1. 08 5月, 2013 3 次提交
    • 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 30 次提交