Skip to content

sysfs.Mdraids() fails if any MD raid array has a delayed check or resync #770

@siebenmann

Description

@siebenmann

If you have multiple software RAID arrays that share physical devices and you trigger a check or a resync for more than one of them, the Linux kernel MD layer notices this situation and normally delays the action on all but one device. For example:

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sdb2[0] sda2[1]
      972946432 blocks super 1.2 [2/2] [UU]
      [=========>...........]  check = 45.5% (442910144/972946432) finish=55.6min speed=158752K/sec
      bitmap: 2/8 pages [8KB], 65536KB chunk

md1 : active raid1 sdb3[0] sda3[1]
      3677184 blocks super 1.2 [2/2] [UU]
        resync=DELAYED
      
unused devices: <none>

When this is happening, /sys/block/md*/md/sync_completed will contain 'delayed' for any delayed arrays. This causes sysfs.Mdraids() to incorrectly fail, as the code assumes that sync_completed will contain either 'none' or '%d / %d', and attempting to parse 'completed' as the latter returns an 'expected integer' error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions