← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~dbungert/curtin:resize-no-format-action into curtin:master

 


Diff comments:

> diff --git a/curtin/commands/block_meta_v2.py b/curtin/commands/block_meta_v2.py
> index c1e3630..fd87acc 100644
> --- a/curtin/commands/block_meta_v2.py
> +++ b/curtin/commands/block_meta_v2.py
> @@ -351,18 +356,7 @@ def disk_handler_v2(info, storage_config, handlers):
>              if needs_resize(storage_config, action, part_info):

Decided to do this on this branch.

>                  resizes[entry.start] = _prepare_resize(entry, part_info, table)
>              preserved_offsets.add(entry.start)
> -        wipe = wipes[entry.start] = _wipe_for_action(action)
> -        if wipe is not None:
> -            # We do a quick wipe of where any new partitions will be,
> -            # because if there is bcache or other metadata there, this
> -            # can cause the partition to be used by a storage
> -            # subsystem and preventing the exclusive open done by the
> -            # wipe_volume call below. See
> -            # https://bugs.launchpad.net/curtin/+bug/1718699 for all
> -            # the gory details.
> -            wipe_offset = table.sectors2bytes(entry.start)
> -            LOG.debug('Wiping 1M on %s at offset %s', disk, wipe_offset)
> -            block.zero_file_at_offsets(disk, [wipe_offset], exclusive=False)
> +        wipes[entry.start] = _wipe_for_action(action)
>  
>      for kname, nr, offset, size in block.sysfs_partition_data(disk):
>          offset_sectors = table.bytes2sectors(offset)
> @@ -371,19 +365,28 @@ def disk_handler_v2(info, storage_config, handlers):
>              block.wipe_volume(block.kname_to_path(kname), 'superblock')
>          resize = resizes.get(offset_sectors)
>          if resize and size > resize['end']:
> -            perform_resize(kname, resize['end'], 'down')
> +            perform_resize(kname, resize, 'down')
>  

Moving wipe changes to another branch.

>      table.apply(disk)
>  
>      for kname, number, offset, size in block.sysfs_partition_data(disk):
>          offset_sectors = table.bytes2sectors(offset)
> -        mode = wipes[offset_sectors]
> -        if mode is not None:
> +        wipe = wipes[offset_sectors]
> +        if wipe is not None:
> +            # We do a quick wipe of where any new partitions will be,
> +            # because if there is bcache or other metadata there, this
> +            # can cause the partition to be used by a storage
> +            # subsystem and preventing the exclusive open done by the
> +            # wipe_volume call below. See
> +            # https://bugs.launchpad.net/curtin/+bug/1718699 for all
> +            # the gory details.
> +            LOG.debug('Wiping 1M on %s at offset %s', disk, offset)
> +            block.zero_file_at_offsets(disk, [offset], exclusive=False)

Moving wipe changes to another branch.

>              # Wipe the new partitions as needed.
> -            block.wipe_volume(block.kname_to_path(kname), mode)
> +            block.wipe_volume(block.kname_to_path(kname), wipe)
>          resize = resizes.get(offset_sectors)
>          if resize and resize['start'] < size:
> -            perform_resize(kname, resize['end'], 'up')
> +            perform_resize(kname, resize, 'up')
>  
>      # Make the names if needed
>      if 'name' in info:


-- 
https://code.launchpad.net/~dbungert/curtin/+git/curtin/+merge/419640
Your team curtin developers is subscribed to branch curtin:master.



References