Suspend writes in RAID1 if within range

If there is a resync going on, all nodes must suspend writes to the
range. This is recorded in the suspend_info/suspend_list.

If there is an I/O within the ranges of any of the suspend_info,
should_suspend will return 1.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
这个提交包含在:
Goldwyn Rodrigues
2014-06-07 02:39:37 -05:00
父节点 e59721ccdc
当前提交 589a1c4916
修改 4 个文件,包含 30 行新增3 行删除

查看文件

@@ -723,6 +723,25 @@ static void resync_finish(struct mddev *mddev)
resync_send(mddev, RESYNCING, 0, 0);
}
static int area_resyncing(struct mddev *mddev, sector_t lo, sector_t hi)
{
struct md_cluster_info *cinfo = mddev->cluster_info;
int ret = 0;
struct suspend_info *s;
spin_lock_irq(&cinfo->suspend_lock);
if (list_empty(&cinfo->suspend_list))
goto out;
list_for_each_entry(s, &cinfo->suspend_list, list)
if (hi > s->lo && lo < s->hi) {
ret = 1;
break;
}
out:
spin_unlock_irq(&cinfo->suspend_lock);
return ret;
}
static struct md_cluster_operations cluster_ops = {
.join = join,
.leave = leave,
@@ -733,6 +752,7 @@ static struct md_cluster_operations cluster_ops = {
.metadata_update_start = metadata_update_start,
.metadata_update_finish = metadata_update_finish,
.metadata_update_cancel = metadata_update_cancel,
.area_resyncing = area_resyncing,
};
static int __init cluster_init(void)