'Ensure that the restore volume is the correct size.
If the restore volume was bigger than the backup, the diff restore will
shrink it to the size of the original backup so we need to
post-process and resize it back to its expected size.'

def _check_restore_vol_size(self, backup, restore_vol, restore_length, src_pool):

    backup_base = self._get_backup_base_name(backup.volume_id, diff_format=True)
    with rbd_driver.RADOSClient(self, backup.container) as client:
        adjust_size = 0
        base_image = self.rbd.Image(client.ioctx, utils.convert_str(backup_base), read_only=True)
        try:
            if (restore_length != base_image.size()):
                adjust_size = restore_length
        finally:
            base_image.close()
    if adjust_size:
        with rbd_driver.RADOSClient(self, src_pool) as client:
            restore_vol_encode = utils.convert_str(restore_vol)
            dest_image = self.rbd.Image(client.ioctx, restore_vol_encode)
            try:
                LOG.debug('Adjusting    restore    vol    size')
                dest_image.resize(adjust_size)
            finally:
                dest_image.close()
