Received: from eggs.gnu.org ([2001:4830:134:3::10]:47086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXrYH-0005tT-IA for qemu-devel@nongnu.org; Mon, 22 Feb 2016 09:33:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXrYD-0006dl-HS for qemu-devel@nongnu.org; Mon, 22 Feb 2016 09:33:29 -0500 Received: from smtp3.mundo-r.com ([212.51.32.191]:65020 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXrYD-0006dA-AC for qemu-devel@nongnu.org; Mon, 22 Feb 2016 09:33:25 -0500 From: Alberto Garcia In-Reply-To: <1456134637-421-2-git-send-email-xiecl.fnst@cn.fujitsu.com> References: <1456134637-421-1-git-send-email-xiecl.fnst@cn.fujitsu.com> <1456134637-421-2-git-send-email-xiecl.fnst@cn.fujitsu.com> Date: Mon, 22 Feb 2016 15:33:23 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v3 1/1] quorum: modify vote rules for flush operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Changlong Xie , qemu devel , Eric Blake , Kevin Wolf , Max Reitz Cc: "Dr. David Alan Gilbert" On Mon 22 Feb 2016 10:50:37 AM CET, Changlong Xie wrote: > - winner = quorum_get_vote_winner(&error_votes); > - result = winner->value.l; > - > + if (success_count >= s->threshold) > + result = 0; > + else { > + winner = quorum_get_vote_winner(&error_votes); > + result = winner->value.l; > + } Please use braces in both branches of the if. scripts/checkpatch.pl should report that. Other than that I think the patch is correct, but I still wonder if we should emit QUORUM_REPORT_BAD (or a new event) for the operations that fail. Or why wouldn't the user want to be notified of a flush failure? Berto