mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 08:16:45 +07:00
818da59f97
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>
34 lines
1.2 KiB
C
34 lines
1.2 KiB
C
|
|
|
|
#ifndef _MD_CLUSTER_H
|
|
#define _MD_CLUSTER_H
|
|
|
|
#include "md.h"
|
|
|
|
struct mddev;
|
|
struct md_rdev;
|
|
|
|
struct md_cluster_operations {
|
|
int (*join)(struct mddev *mddev, int nodes);
|
|
int (*leave)(struct mddev *mddev);
|
|
int (*slot_number)(struct mddev *mddev);
|
|
int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi);
|
|
int (*metadata_update_start)(struct mddev *mddev);
|
|
int (*metadata_update_finish)(struct mddev *mddev);
|
|
void (*metadata_update_cancel)(struct mddev *mddev);
|
|
int (*resync_start)(struct mddev *mddev);
|
|
int (*resync_finish)(struct mddev *mddev);
|
|
int (*area_resyncing)(struct mddev *mddev, int direction, sector_t lo, sector_t hi);
|
|
int (*add_new_disk)(struct mddev *mddev, struct md_rdev *rdev);
|
|
void (*add_new_disk_cancel)(struct mddev *mddev);
|
|
int (*new_disk_ack)(struct mddev *mddev, bool ack);
|
|
int (*remove_disk)(struct mddev *mddev, struct md_rdev *rdev);
|
|
void (*load_bitmaps)(struct mddev *mddev, int total_slots);
|
|
int (*gather_bitmaps)(struct md_rdev *rdev);
|
|
int (*lock_all_bitmaps)(struct mddev *mddev);
|
|
void (*unlock_all_bitmaps)(struct mddev *mddev);
|
|
void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors);
|
|
};
|
|
|
|
#endif /* _MD_CLUSTER_H */
|