From patchwork Wed Oct 14 07:25:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Chen" X-Patchwork-Id: 271312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,FROM_WSP_TRAIL, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76D2AC433E7 for ; Wed, 14 Oct 2020 07:35:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D507A20878 for ; Wed, 14 Oct 2020 07:35:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D507A20878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSbJV-0006fI-O5 for qemu-devel@archiver.kernel.org; Wed, 14 Oct 2020 03:35:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSbDB-0007qL-Ne for qemu-devel@nongnu.org; Wed, 14 Oct 2020 03:28:37 -0400 Received: from mga05.intel.com ([192.55.52.43]:54365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSbDA-00041U-4A for qemu-devel@nongnu.org; Wed, 14 Oct 2020 03:28:37 -0400 IronPort-SDR: 6WjziNfwlPTwbOCLO2kjTh1DrQNtNFxOdrZX9V9YsC0BRcVZC6SlMwLC3DTM1p8DLuApEg4Okx DqlxBqexPufQ== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="250751933" X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="250751933" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 00:28:32 -0700 IronPort-SDR: reEkN+RWHr+X0/hmgBGmOJ+x8Eb6UuR3aO37kQ1fAvZHCqftGKJpd8WuC4scYA27d3rVG5yAVc T5U3k61i8zWw== X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="521323052" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 00:28:30 -0700 From: Zhang Chen To: Jason Wang , qemu-dev Subject: [PATCH 06/10] colo-compare: check mark in mutual exclusion Date: Wed, 14 Oct 2020 15:25:52 +0800 Message-Id: <20201014072555.12515-7-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201014072555.12515-1-chen.zhang@intel.com> References: <20201014072555.12515-1-chen.zhang@intel.com> Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/14 03:28:22 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, FROM_ADDR_WS=2.999, FROM_WSP_TRAIL=2.199, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Li Zhijian , Zhang Chen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Li Zhijian Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Reviewed-by: Zhang Chen --- net/colo-compare.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 86980cef5e..24c366eec0 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -476,13 +476,11 @@ sec: colo_release_primary_pkt(s, ppkt); g_queue_push_head(&conn->secondary_list, spkt); goto pri; - } - if (mark == COLO_COMPARE_FREE_SECONDARY) { + } else if (mark == COLO_COMPARE_FREE_SECONDARY) { conn->compare_seq = spkt->seq_end; packet_destroy(spkt, NULL); goto sec; - } - if (mark == (COLO_COMPARE_FREE_PRIMARY | COLO_COMPARE_FREE_SECONDARY)) { + } else if (mark == (COLO_COMPARE_FREE_PRIMARY | COLO_COMPARE_FREE_SECONDARY)) { conn->compare_seq = ppkt->seq_end; colo_release_primary_pkt(s, ppkt); packet_destroy(spkt, NULL);