Merge ~raharper/curtin:fix/clear-holders-bcache-partitions-lp1811117-v2 into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Chad Smith
Approved revision: 0723e0da24e859d78b893dd14b8f4e96efa78915
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:fix/clear-holders-bcache-partitions-lp1811117-v2
Merge into: curtin:master
Diff against target: 16 lines (+4/-1)
1 file modified
curtin/block/clear_holders.py (+4/-1)
Reviewer Review Type Date Requested Status
Chad Smith Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+362352@code.launchpad.net

Commit message

bcache: ensure partitions on bcache devices are detected as partition

In some cases, when curtin is discovering existing storage devices, a
bcache device with partitions created on top of it, may be recognized
as a bcache device, rather than a partition. If curtin treats a
bcache partition as a bcache device, it will attempt to write to
non-existent files on /sys which results in a failure after timing
out. Resolve this issue by detecting if the target device is a
partition inside the bcache identity function.

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
Chad Smith (chad.smith) wrote :

+1 LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/clear_holders.py b/curtin/block/clear_holders.py
2index 05d756c..d722669 100644
3--- a/curtin/block/clear_holders.py
4+++ b/curtin/block/clear_holders.py
5@@ -410,7 +410,10 @@ def identify_bcache(device):
6 """
7 determine if specified device is a bcache device
8 """
9- return block.path_to_kname(device).startswith('bcache')
10+ # bcache devices can be partitioned and the partitions are *not*
11+ # bcache devices with a sysfs 'slaves' subdirectory
12+ partition = identify_partition(device)
13+ return block.path_to_kname(device).startswith('bcache') and not partition
14
15
16 def identify_partition(device):

Subscribers

People subscribed via source and target branches