• Lars Ellenberg's avatar
    drbd: fix confusing error message during attach · 4ef2a4f4
    Lars Ellenberg authored
    If we attach a (consistent) backing device,
    which knows about a last-agreed effective size,
    and that effective size is *larger* than the currently requested size,
    we refused to attach with ERR_DISK_TOO_SMALL
      Failure: (111) Low.dev. smaller than requested DRBD-dev. size.
    which is confusing to say the least.
    
    This patch changes the error code in that case to ERR_IMPLICIT_SHRINK
      Failure: (170) Implicit device shrinking not allowed. See kernel log.
      additional info from kernel:
      To-be-attached device has last effective > current size, and is consistent
      (9999 > 7777 sectors). Refusing to attach.
    
    It also allows to attach with an explicit size.
    Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    4ef2a4f4
drbd_nl.c 147 KB