mirror of
https://github.com/torvalds/linux.git
synced 2024-10-30 00:32:38 +00:00
drbd: Fix adding of new minors with freshly created meta data
Online adding of new minors with freshly created meta data to an resource with an established connection failed, with a wrong state transition on one side on one side of the new minor. Freshly created meta-data has a la_size (last agreed size) of 0. When we online add such devices, the code wrongly got into the code path for resyncing new storage that was added while the disk was detached. Fixed that by making the GREW from ZERO a special case. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
b874d231e1
commit
57737adc96
@ -1474,7 +1474,8 @@ enum determine_dev_size {
|
||||
DS_ERROR = -1,
|
||||
DS_UNCHANGED = 0,
|
||||
DS_SHRUNK = 1,
|
||||
DS_GREW = 2
|
||||
DS_GREW = 2,
|
||||
DS_GREW_FROM_ZERO = 3,
|
||||
};
|
||||
extern enum determine_dev_size
|
||||
drbd_determine_dev_size(struct drbd_conf *, enum dds_flags, struct resize_parms *) __must_hold(local);
|
||||
|
@ -955,7 +955,7 @@ drbd_determine_dev_size(struct drbd_conf *mdev, enum dds_flags flags, struct res
|
||||
}
|
||||
|
||||
if (size > la_size_sect)
|
||||
rv = DS_GREW;
|
||||
rv = la_size_sect ? DS_GREW : DS_GREW_FROM_ZERO;
|
||||
if (size < la_size_sect)
|
||||
rv = DS_SHRUNK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user