Comment 18 for bug 1893661

Revision history for this message
György Szombathelyi (gyurco) wrote :

Only one blocker remaining for a successful reinstall in shutdown_mdadm:

    LOG.debug('Wiping mdadm member devices: %s' % md_devs)
    for mddev in md_devs:
        mdadm.zero_device(mddev, force=True)

As the devices in an array are held by the container, the zero_device above fail (as it cannot get an exclusive lock). As I see, the device list for an array is get from /sys/block/mdxxx/md/dev-*, and unfortunately it's populated by the underlying drives in both the array and the container.

Is it acceptable to make the mdadm.zero_device failure non-fatal? Otherwise it must be detected if an md device is in a container, which isn't straightforward.

Or maybe doing a query in mdadm_shutdown, and skip zeroing if it contains a container: key?

mdadm --query --detail /dev/md126
/dev/md126:
         Container : /dev/md/imsm0, member 0
        Raid Level : raid5
        Array Size : 2930270208 (2794.52 GiB 3000.60 GB)
     Used Dev Size : 976756736 (931.51 GiB 1000.20 GB)
      Raid Devices : 4
     Total Devices : 4

             State : active, resyncing
    Active Devices : 4
   Working Devices : 4
    Failed Devices : 0
     Spare Devices : 0

            Layout : left-asymmetric
        Chunk Size : 128K