• Lars Ellenberg's avatar
    drbd: fix error path during resize · 8011e249
    Lars Ellenberg authored
    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: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    8011e249
drbd_nl.c 140 KB