From owner-svn-src-all@FreeBSD.ORG Thu Oct 27 18:45:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E92941065674; Thu, 27 Oct 2011 18:45:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D49E38FC0C; Thu, 27 Oct 2011 18:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9RIj1Sb019919; Thu, 27 Oct 2011 18:45:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9RIj1lJ019918; Thu, 27 Oct 2011 18:45:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201110271845.p9RIj1lJ019918@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Oct 2011 18:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226851 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 18:45:02 -0000 Author: pjd Date: Thu Oct 27 18:45:01 2011 New Revision: 226851 URL: http://svn.freebsd.org/changeset/base/226851 Log: 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 Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Oct 27 17:44:51 2011 (r226850) +++ head/sbin/hastd/primary.c Thu Oct 27 18:45:01 2011 (r226851) @@ -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);