Permalink
Browse files

MFC r257154:

Merging local and remote bitmaps must be protected by hr_amp lock.

This is believed to fix hastd crashes, which might occur during
synchronization, triggered by the failed assertion:

 Assertion failed: (amp->am_memtab[ext] > 0),
 function activemap_write_complete, file activemap.c, line 351.

Approved by:	re (glebius)
  • Loading branch information...
1 parent 5c41fcf commit 69528385720f530d530392d3bdd4fa0ebcbdc8ad @trociny trociny committed Oct 31, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 sbin/hastd/primary.c
@@ -781,6 +781,7 @@ init_remote(struct hast_resource *res, struct proto_conn **inp,
free(map);
goto close;
}
+ mtx_lock(&res->hr_amp_lock);
/*
* Merge local and remote bitmaps.
*/
@@ -790,7 +791,6 @@ init_remote(struct hast_resource *res, struct proto_conn **inp,
* Now that we merged bitmaps from both nodes, flush it to the
* disk before we start to synchronize.
*/
- mtx_lock(&res->hr_amp_lock);
(void)hast_activemap_flush(res);
}
nv_free(nvin);

0 comments on commit 6952838

Please sign in to comment.