• Iustin Pop's avatar
    Fix a unhandled error case in device creation · cf5a8306
    Iustin Pop authored
    The block device creation process is the following:
      - device create
      - device assembly (on primary or depending on dev_type, on secondary
      - set sync speed
      - return
    The problem is that device assembly after creation was not checked for
    errors, and as this is a very unusual case, we did not have problems
    with it (or we didn't detect them). The recent DevCacheManager however
    tripped on this case (because the dev_path of the device is None if the
    assembly fails) and the creation aborted with an unclear error message.
    The patch adds a check for the assembly success and aborts the creation
    of the device in this case - the error is quite clear in the instance
    add, for example. The patch also changes DevCacheManager to log the
    cases when dev_path is None but not raise an error (keeping consistent
    with the goal that the cache manager should be transparent to the code).
    For the record, this error case was detected with a mismatch between
    drbd kernel module and utilities.
    Reviewed-by: imsnah