]> www.infradead.org Git - nvme.git/commit
drbd: fix confusing error message during attach
authorLars Ellenberg <lars.ellenberg@linbit.com>
Thu, 20 Dec 2018 16:23:33 +0000 (17:23 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 20 Dec 2018 16:51:30 +0000 (09:51 -0700)
commit4ef2a4f43f5e52c6ff50a53cb49cf468bacf8cc2
tree9292f4cb6d70d8b2ed59da6cee4505cdf01712b9
parentb17b59602b6dcf8f97a7dc7bc489a48388d7063a
drbd: fix confusing error message during attach

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: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_nl.c