From 8a34134ac2f68e847f60e9ae8737b976ab0496c5 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 27 Oct 2011 18:45:01 +0000 Subject: [PATCH] Delay resuid generation until first connection to secondary, not until first write. This way on first connection we will synchronize only the extents that were modified during the lifetime of primary node, not entire GEOM provider. MFC after: 3 days --- sbin/hastd/primary.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c index 21e888a84997..4cdbf0faa407 100644 --- a/sbin/hastd/primary.c +++ b/sbin/hastd/primary.c @@ -1159,13 +1159,10 @@ ggate_recv_thread(void *arg) break; case BIO_WRITE: res->hr_stat_write++; - if (res->hr_resuid == 0) { - /* - * This is first write, initialize localcnt and - * resuid. - */ + if (res->hr_resuid == 0 && + res->hr_primary_localcnt == 0) { + /* This is first write. */ res->hr_primary_localcnt = 1; - (void)init_resuid(res); } for (;;) { mtx_lock(&range_lock);