Commit 07169fd4 authored by majianpeng's avatar majianpeng Committed by NeilBrown

raid1: Replace raise_barrier/lower_barrier with freeze_array/unfreeze_array...

raid1: Replace raise_barrier/lower_barrier with freeze_array/unfreeze_array when reconfiguring the array.

We used to use raise_barrier to suspend normal IO while we reconfigure
the array.  However raise_barrier will soon only suspend some normal
IO, not all.  So we need something else.
Change it to use freeze_array.
But freeze_array not only suspends normal io, it also suspends
resync io.
For the place where call raise_barrier for reconfigure, it isn't a
problem.
Signed-off-by: default avatarJianpeng Ma <majianpeng@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent b364e3d0
...@@ -2870,8 +2870,8 @@ static int stop(struct mddev *mddev) ...@@ -2870,8 +2870,8 @@ static int stop(struct mddev *mddev)
atomic_read(&bitmap->behind_writes) == 0); atomic_read(&bitmap->behind_writes) == 0);
} }
raise_barrier(conf); freeze_array(conf, 0);
lower_barrier(conf); unfreeze_array(conf);
md_unregister_thread(&mddev->thread); md_unregister_thread(&mddev->thread);
if (conf->r1bio_pool) if (conf->r1bio_pool)
...@@ -3030,10 +3030,10 @@ static void raid1_quiesce(struct mddev *mddev, int state) ...@@ -3030,10 +3030,10 @@ static void raid1_quiesce(struct mddev *mddev, int state)
wake_up(&conf->wait_barrier); wake_up(&conf->wait_barrier);
break; break;
case 1: case 1:
raise_barrier(conf); freeze_array(conf, 0);
break; break;
case 0: case 0:
lower_barrier(conf); unfreeze_array(conf);
break; break;
} }
} }
...@@ -3050,7 +3050,8 @@ static void *raid1_takeover(struct mddev *mddev) ...@@ -3050,7 +3050,8 @@ static void *raid1_takeover(struct mddev *mddev)
mddev->new_chunk_sectors = 0; mddev->new_chunk_sectors = 0;
conf = setup_conf(mddev); conf = setup_conf(mddev);
if (!IS_ERR(conf)) if (!IS_ERR(conf))
conf->barrier = 1; /* Array must appear to be quiesced */
conf->array_frozen = 1;
return conf; return conf;
} }
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment