]> git.baikalelectronics.ru Git - kernel.git/commit
drbd: fix error path during resize
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 8 Jun 2015 12:48:38 +0000 (14:48 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 16:22:03 +0000 (09:22 -0700)
commit734db15c96c2d6a5dea5f3086faa77a86eeb3d65
tree129376759401915b665e06c5f65c91fe65c90494
parent8a5b8cf2790d1b79b9b9c39abfc1f54bd56565b2
drbd: fix error path during resize

In case the lower level device size changed, but some other internal
details of the resize did not work out, drbd_determine_dev_size() would
try to restore the previous settings, trusting
drbd_md_set_sector_offsets() to "do the right thing", but overlooked
that this internally may set the meta data base offset based on device size.

This could end up with incomplete on-disk meta data layout change, and
ultimately lead to data corruption (if the failure was not noticed or
ignored by the operator, and other things go wrong as well).

Just remember all meta data related offsets/sizes,
and on error restore them all.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_nl.c