Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19868974rwd; Wed, 28 Jun 2023 15:54:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UwGqZ8AEtV0A8ZhRl8EYUQmcNdxk0U7LfH4E9w9NyVDhbxSHTvzktE5kSkttrhJifNidU X-Received: by 2002:a05:6a00:3a23:b0:668:9fb6:b311 with SMTP id fj35-20020a056a003a2300b006689fb6b311mr29294169pfb.32.1687992841668; Wed, 28 Jun 2023 15:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687992841; cv=none; d=google.com; s=arc-20160816; b=U4m0otrEfW7ABRCsij0NtwbdHc3LaoTFWs0TU2O0T5Nfp2OeV7PwyBS3GWigdoBa2b d+qBzO3FuIk/m6swnBV2olFN9SYtVmDYWppzDQFwd175jmY+8BgVIHIBKmxyhiT3XcWR pj7cyMG6jXpmyU27jt1B35hE45kJ6Vs4eD3N7n6WbhjsgJtGB09NcxCn8IZt0iW0kXRD oYva2x8KF6dNS3PADeQ27eGJcZAzLNF6yBA3Me9GqnUmu+GgJ5GiPN8US6hkCtIkoXmx 5qfXFi3Ps/dHy9a2dr+nPXnN9c57xl4n6MyNXL9Thmi0aSdgBAC08ix9hZ2PSjeQZfKi Zu+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5qx6oeg4El3r9W1xM70L/5el3NdsxAOk3IGgWD9gL+c=; fh=CPpRkOwF9GTwy0wtS3lMI/VOqqhYg/hdxkBimukKAqo=; b=tqiPCaNatCIoHuoAkOhp9Esa+Xt4DoAFTtCppeYdjlm7wNXS7EYXehyikI4ZiupPh8 URZr/6kwEIiBgv664df8mog5r9W9vSyzstvKtgnElJS4Okxyvj5+qLGvBhSg7XqMRFvc /z3/pW/vcIezomglDxeQiVez6dJg/HkOwbdKZxzl9s0dSNaSi48JVvBSK9qusviAuQld T/JokaZRcbiS+4oaqo7f6BVhvpUKfJHFiBYeBNfs+5mr+4wxJB3RqFwNLGhYFP0fw6IR yPNY9kVV+ICrs184uTslbZ+B7DT0JgnxG7zQDrHWNc/12G7ikmM20jc0+HPIs14dzmZN 8wbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f82L7Wjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t28-20020a63535c000000b0054fd9e9b862si9369345pgl.232.2023.06.28.15.53.45; Wed, 28 Jun 2023 15:54:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f82L7Wjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231547AbjF1Wnl (ORCPT + 99 others); Wed, 28 Jun 2023 18:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbjF1WnX (ORCPT ); Wed, 28 Jun 2023 18:43:23 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8B5B213C; Wed, 28 Jun 2023 15:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687992202; x=1719528202; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QjzjGI4HpC0gb3kGtq3uL/qndabYhUtInoPjaSCgPgg=; b=f82L7Wjff/dnkVUYF6U5Yrsz0DAT1PWwG9TGL5jdtlmrBpipKrZ5HjoC 91HycWsmFRdvPQ+glY7cwo786/mtyfnSBI+8RUPa9AcCY2bYLzz3aZUak +vip3ONcSJLsIHHxB1BouaR5dPNyu73v6CA+waHtto67PI6qhoTag+SaH LC4OhVb5sE75s7FPLMYXQULVtLz7NGy6K2eqEhfnLhb0BlUMQ6T410CM4 VwLucr7ZRtdDOWfNMSzHv4qN8aqcQ4tXXdeEzZTJRkgBFo/EPDMGDaz+b Zji59nCEUkxsGPFJI+YYO+Rsk1TNSV/JR+Z4MUMJmjfutcer3m1B+Cpws w==; X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="392699122" X-IronPort-AV: E=Sophos;i="6.01,166,1684825200"; d="scan'208";a="392699122" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 15:43:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="830299984" X-IronPort-AV: E=Sophos;i="6.01,166,1684825200"; d="scan'208";a="830299984" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 15:43:20 -0700 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , David Matlack , Kai Huang , Zhi Wang , chen.bo@intel.com, linux-coco@lists.linux.dev, Chao Peng , Ackerley Tng , Vishal Annapurve , Michael Roth , Yuan Yao Subject: [RFC PATCH v3 02/11] KVM: selftests: Fix guest_memfd() Date: Wed, 28 Jun 2023 15:43:01 -0700 Message-Id: <4095debe0b61fd7de1884ef82d671d30277a9251.1687991811.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Isaku Yamahata Some test cases should succeed. Check !ret instead of ret. Fixes: 36eedd5b91e3 ("KVM: selftests: Add basic selftest for guest_memfd()") Signed-off-by: Isaku Yamahata --- Changes v2 -> v3: - no change Changes v1 -> v2: - no change --- tools/testing/selftests/kvm/guest_memfd_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/guest_memfd_test.c b/tools/testing/selftests/kvm/guest_memfd_test.c index 3b6532b833b2..f3b99c1e5464 100644 --- a/tools/testing/selftests/kvm/guest_memfd_test.c +++ b/tools/testing/selftests/kvm/guest_memfd_test.c @@ -72,11 +72,11 @@ static void test_fallocate(int fd, size_t page_size, size_t total_size) ret = fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, total_size, page_size); - TEST_ASSERT(ret, "fallocate(PUNCH_HOLE) at total_size should be fine (no-op)"); + TEST_ASSERT(!ret, "fallocate(PUNCH_HOLE) at total_size should be fine (no-op)"); ret = fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, total_size + page_size, page_size); - TEST_ASSERT(ret, "fallocate(PUNCH_HOLE) after total_size should be fine (no-op)"); + TEST_ASSERT(!ret, "fallocate(PUNCH_HOLE) after total_size should be fine (no-op)"); ret = fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, page_size, page_size - 1); -- 2.25.1