Skip to content
Snippets Groups Projects
Commit 2d0c8319 authored by Iustin Pop's avatar Iustin Pop
Browse files

drbd: change the semantics of Attach vs. Assemble

Currently, both the Attach and Assemble methods for DRBD8 devices will use and
alter the device state. This is suboptimal, and it has been worked
around in 1.2 via a special cache in the node daemon so that we don't
need to call Attach() again in migration, for example.

Since in 2.0 we have static minors, we can change these functions so
that:
  - Attach() does not affect the device in any way, and only checks if
    the minor is already in use or not
  - Assemble() has two logic paths, one for startup from unused minor
    (the old Assemble, now renamed _FastAssemble) and one for
    re-checking/fixing an in-use minor (the old Attach, now renamed
    _SlowAttach)

Basically Attach was renamed to _SlowAttach, Assemble to _FastAssemble,
and we have a new, simple Assemble that calls one or the other based on
the result of the new Attach.

The LUReplaceDisks (with new secondary) is relying on the special
semantics of Attach modifying the device and is broken until the end of
the patch series.

Reviewed-by: ultrotter
parent f87548b5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment