summaryrefslogtreecommitdiff
path: root/drivers/md/md-cluster.c
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2015-08-14 20:19:40 +0300
committerGoldwyn Rodrigues <rgoldwyn@suse.com>2015-10-12 09:29:59 +0300
commit9ed38ff53090856769b99e9d2f19740fb11e6956 (patch)
tree87d793d755b2d5128a524d935904ae1a7159d15a /drivers/md/md-cluster.c
parentda6fb7a9e5bd6f04f7e15070f630bdf1ea502841 (diff)
downloadlinux-9ed38ff53090856769b99e9d2f19740fb11e6956.tar.xz
md-cluster: complete all write requests before adding suspend_info
process_suspend_info - which handles the RESYNCING request - must not reply until all writes which were initiated before the request arrived, have completed. As a by-product, all process_* functions now take mddev as their first arguement making it uniform. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/md-cluster.c')
-rw-r--r--drivers/md/md-cluster.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 11e3bc9d2a4b..4a965f22be20 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -374,9 +374,10 @@ static void remove_suspend_info(struct md_cluster_info *cinfo, int slot)
}
-static void process_suspend_info(struct md_cluster_info *cinfo,
+static void process_suspend_info(struct mddev *mddev,
int slot, sector_t lo, sector_t hi)
{
+ struct md_cluster_info *cinfo = mddev->cluster_info;
struct suspend_info *s;
if (!hi) {
@@ -389,6 +390,8 @@ static void process_suspend_info(struct md_cluster_info *cinfo,
s->slot = slot;
s->lo = lo;
s->hi = hi;
+ mddev->pers->quiesce(mddev, 1);
+ mddev->pers->quiesce(mddev, 0);
spin_lock_irq(&cinfo->suspend_lock);
/* Remove existing entry (if exists) before adding */
__remove_suspend_info(cinfo, slot);
@@ -457,7 +460,7 @@ static void process_recvd_msg(struct mddev *mddev, struct cluster_msg *msg)
case RESYNCING:
pr_info("%s: %d Received message: RESYNCING from %d\n",
__func__, __LINE__, msg->slot);
- process_suspend_info(mddev->cluster_info, msg->slot,
+ process_suspend_info(mddev, msg->slot,
msg->low, msg->high);
break;
case NEWDISK: