Merge ~mwhudson/curtin:v2-zero-before-partitioning into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 5b09e407fa3350d0da82cc313b656a8f027eea4c
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:v2-zero-before-partitioning
Merge into: curtin:master
Diff against target: 24 lines (+12/-1)
1 file modified
curtin/commands/block_meta_v2.py (+12/-1)
Reviewer Review Type Date Requested Status
Dan Bungert Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+416002@code.launchpad.net

Commit message

block_meta_v2: zero start of partitions before they are created

Hooray for regression tests for bug 1718699.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
435b484... by Michael Hudson-Doyle

oops

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
5b09e40... by Michael Hudson-Doyle

exclusive=False here

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dan Bungert (dbungert) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/block_meta_v2.py b/curtin/commands/block_meta_v2.py
2index 85e0c20..26f5e6a 100644
3--- a/curtin/commands/block_meta_v2.py
4+++ b/curtin/commands/block_meta_v2.py
5@@ -252,7 +252,18 @@ def disk_handler_v2(info, storage_config, handlers):
6 part_info = _find_part_info(sfdisk_info, entry.start)
7 partition_verify_sfdisk(action, sfdisk_info['label'], part_info)
8 preserved_offsets.add(entry.start)
9- wipes[entry.start] = _wipe_for_action(action)
10+ wipe = wipes[entry.start] = _wipe_for_action(action)
11+ if wipe is not None:
12+ # We do a quick wipe of where any new partitions will be,
13+ # because if there is bcache or other metadata there, this
14+ # can cause the partition to be used by a storage
15+ # subsystem and preventing the exclusive open done by the
16+ # wipe_volume call below. See
17+ # https://bugs.launchpad.net/curtin/+bug/1718699 for all
18+ # the gory details.
19+ wipe_offset = table.sectors2bytes(entry.start)
20+ LOG.debug('Wiping 1M on %s at offset %s', disk, wipe_offset)
21+ block.zero_file_at_offsets(disk, [wipe_offset], exclusive=False)
22
23 # Do a superblock wipe of any partitions that are being deleted.
24 for kname, nr, offset, sz in block.sysfs_partition_data(disk):

Subscribers

People subscribed via source and target branches