]> git.baikalelectronics.ru Git - kernel.git/commit
md-cluster: add the support for resize
authorGuoqing Jiang <gqjiang@suse.com>
Wed, 1 Mar 2017 08:42:40 +0000 (16:42 +0800)
committerShaohua Li <shli@fb.com>
Thu, 16 Mar 2017 23:55:50 +0000 (16:55 -0700)
commitc63ec10f81976a3243dd137a9113b7222bea82af
treec63c89cc1e0293d75685f3639c41a381acf7be13
parentef972fd24574ff7f42526b163cf1057af98b7e8e
md-cluster: add the support for resize

To update size for cluster raid, we need to make
sure all nodes can perform the change successfully.
However, it is possible that some of them can't do
it due to failure (bitmap_resize could fail). So
we need to consider the issue before we set the
capacity unconditionally, and we use below steps
to perform sanity check.

1. A change the size, then broadcast METADATA_UPDATED
   msg.
2. B and C receive METADATA_UPDATED change the size
   excepts call set_capacity, sync_size is not update
   if the change failed. Also call bitmap_update_sb
   to sync sb to disk.
3. A checks other node's sync_size, if sync_size has
   been updated in all nodes, then send CHANGE_CAPACITY
   msg otherwise send msg to revert previous change.
4. B and C call set_capacity if receive CHANGE_CAPACITY
   msg, otherwise pers->resize will be called to restore
   the old value.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Documentation/md/md-cluster.txt
drivers/md/md-cluster.c
drivers/md/md-cluster.h
drivers/md/md.c