• Iustin Pop's avatar
    Remove checking of DRBD metadata for validity · 3b559640
    Iustin Pop authored
    Currently the DRBD code checks that the metadata devices are valid
    before creation, initial disk attachment and add children.
    However, the process for checking validity requires a free DRBD minor,
    and this conflict with parallel checking.
    There are at least three possible solutions:
      - serialize all checks, which means we reduce parallelism and need
        extra locks
      - don't pass a valid minor number, but one like “/dev/drbd256” (which
        is invalid); this works for current version of DRBD, but since it's
        not guaranteed to remain so it doesn't look nice
      - don't do the checking at all, and rely on “drbdsetup ... disk ...”
        to fail by itself
    The reason for checking metadata was that in 1.2, this was much cheaper
    than trying to activate devices (and the subsequent iteration over the
    minors). However, in 2.0, they have the same cost, so we can choose
    option 3: just remove the explicit checking and rely on drbdsetup and
    the kernel to fail.
    Since DRBD8._InitMeta still requires a minor number, the two places
    where this is run are handled as follows:
      - Create: we just use our own (unused currently) minor number
      - AddChildren: we keep using FindUnusedMinor, with the caveat that
        this function (used by replace-disks -n ...) cannot be yet
    Reviewed-by: ultrotter