Date: Mon, 21 Mar 2011 21:16:12 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219844 - head/sbin/hastd Message-ID: <201103212116.p2LLGCRs020994@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Mon Mar 21 21:16:12 2011 New Revision: 219844 URL: http://svn.freebsd.org/changeset/base/219844 Log: Initialize localcnt on first write. This fixes assertion when we create resource, set role to primary, do no writes, then sent it to secondary and accept connection from primary. MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Mar 21 21:14:07 2011 (r219843) +++ head/sbin/hastd/primary.c Mon Mar 21 21:16:12 2011 (r219844) @@ -478,7 +478,7 @@ init_local(struct hast_resource *res) * that there were no writes yet, so there is no need to synchronize * anything. */ - res->hr_primary_localcnt = 1; + res->hr_primary_localcnt = 0; res->hr_primary_remotecnt = 0; if (metadata_write(res) < 0) exit(EX_NOINPUT); @@ -1093,7 +1093,11 @@ ggate_recv_thread(void *arg) break; case BIO_WRITE: if (res->hr_resuid == 0) { - /* This is first write, initialize resuid. */ + /* + * This is first write, initialize localcnt and + * resuid. + */ + res->hr_primary_localcnt = 1; (void)init_resuid(res); } for (;;) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103212116.p2LLGCRs020994>