Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp75591rdb; Thu, 16 Nov 2023 12:16:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IG91dD6SOf6MvW8P1yjhTaYNvIFm9a9AOfT5PkFWYV0N7ydgxf3KHOHM86F52r/oyNHeA+u X-Received: by 2002:a17:90b:4a49:b0:27d:6404:bffc with SMTP id lb9-20020a17090b4a4900b0027d6404bffcmr18332011pjb.1.1700165785147; Thu, 16 Nov 2023 12:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700165785; cv=none; d=google.com; s=arc-20160816; b=oiaZ1mnHgSU41WqaXYmhqdVkbtMOYn/bh2MyoLm8ZhKj4mmEe6ktZohb2TC39udPiD yGJ3WJdTCFYfBAkM2sgWKUkfOuJFgMtrEX6tvgoL/FawaFCLELVFFyKIl8VxF0IDUVDO zN2yERkXHKKSb3zDaEdiAynC/pO+Vag3rXM3fcRSVR4DNdNFbfdIOo/+5byrxe5F+A0M lZG7KdptiOMyMapCIr0ED8O8sXhBregjizy0qoT+WPQvfi80AfXJb8IotBSyFriR7yN1 kdP1SdqzRkC3j3mtjMLyq+Ax2yNRtjSlKND9XX2IqIv6CyRGPUwnFhsZy967HOx95rqJ 780g== 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=QIfhkJ5q+MuBUNqDP7+llj85JgVyRPSym9vvMGwkwM8=; fh=ONBGb8POD0DAPCHfLkA/ec1VmXEVS74YC25GSOEo2kI=; b=VczI4BBS7rV46cMkn0fdNoCqp49qkd5HmirzYTXKpPWz3PcjNqBOOP9ui7AaZ+uep5 x/EHjlmAoInCsFUiJMdT3Arvly7P1lc93pqDlKRJhw/0VcUKRJeUTZ+pycEQxg8F2u51 vV3ZbjnEE1tV0iNBBEuKG0UVewwBEtD/6opCRVJpYEF6153Ipr1c5oPLWagB66UWjoev sWja8gQ3idfq+yv+ntfCdvSVUAI2GZJkl5ZevmC1cgspYNCj/WWdVsYneLY5SRkkVT1J rWSB6G43IXnzj+sgKGsDS6hQDidH+ETzi5KTs1HN94g76UNDkU/Rtk/A5g+aIZFiyD5a vlbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EMx+bDzk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id mw12-20020a17090b4d0c00b0027cef9ad081si2843146pjb.164.2023.11.16.12.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 12:16:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EMx+bDzk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F184B81DC614; Thu, 16 Nov 2023 12:16:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229448AbjKPUQI (ORCPT + 99 others); Thu, 16 Nov 2023 15:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbjKPUP7 (ORCPT ); Thu, 16 Nov 2023 15:15:59 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B361AD for ; Thu, 16 Nov 2023 12:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700165756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QIfhkJ5q+MuBUNqDP7+llj85JgVyRPSym9vvMGwkwM8=; b=EMx+bDzk8Nr6qdAyyHWiJIBCZsczcUAeVyoyfOnK7j09Dx0o3tGzSJJCquD6Cz1ihDUGAf JT0HHJwk4/AfoDhrwMAauPtQmzUsz8f5AgNWITHtHtSrFhFjXKJrugQ9C/1JawY77aYj1l AAVX7Yom9diVSfpqjEI3NswuF9l+ZL4= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-tfgHdjaBOQGR7f3JsXbUXQ-1; Thu, 16 Nov 2023 15:15:54 -0500 X-MC-Unique: tfgHdjaBOQGR7f3JsXbUXQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-77a02ceef95so18076385a.0 for ; Thu, 16 Nov 2023 12:15:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700165754; x=1700770554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QIfhkJ5q+MuBUNqDP7+llj85JgVyRPSym9vvMGwkwM8=; b=njd9H8AZLVpERM9UglB7S0bIz6/cg74E57X9V/jQUdQnJ6k5UM/BtceOhsJG4NiADj FXuKG04svL3kjY+hmneJ2uqCfxrfFpAECoTfhD4nubOi0CdtGyGn6dQnbXJH7B+TFlxB 93tXymbKZyZWGY082sJWfLR6XOjDjg5LVxN6SyG2LqLi7pO4CKVEZ94hp6EoTaCkxkhh PHj7aPnBVZEwt0r7WOp3Y0pt60lmOwXi+RWcgd3vNSMFzDSzv2Io2vOEibt8IqXh9E+X oetBNT+htpe/A1dDBTzh53/rgT82MmxGPkBsYmi79aqshNDARSFCbDDi3P7bdZ0Btbcp 9ZJg== X-Gm-Message-State: AOJu0Yy7Eci+Q4VuIpONnnc9mZT4ykYTUSaGJ/6Pndh5jeLszd49mUQS lobd2RIzJ9P9dIv1kkXm50wKRUSvaP8WKK9jB/z5Ura81DeljrN2M+BZxpY/jlO8zuxK8kqg4n7 vlapXNR78kzUonyByvZnlpdB4 X-Received: by 2002:a05:620a:460f:b0:777:7178:ebf0 with SMTP id br15-20020a05620a460f00b007777178ebf0mr10983525qkb.5.1700165754345; Thu, 16 Nov 2023 12:15:54 -0800 (PST) X-Received: by 2002:a05:620a:460f:b0:777:7178:ebf0 with SMTP id br15-20020a05620a460f00b007777178ebf0mr10983511qkb.5.1700165754044; Thu, 16 Nov 2023 12:15:54 -0800 (PST) Received: from x1n.redhat.com (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id b19-20020a05620a271300b007659935ce64sm65524qkp.71.2023.11.16.12.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 12:15:53 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: peterx@redhat.com, Muhammad Usama Anjum , Andrew Morton , David Hildenbrand , Andrei Vagin Subject: [PATCH 3/3] mm/selftests: Fix pagemap_ioctl memory map test Date: Thu, 16 Nov 2023 15:15:47 -0500 Message-ID: <20231116201547.536857-4-peterx@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231116201547.536857-1-peterx@redhat.com> References: <20231116201547.536857-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 16 Nov 2023 12:16:23 -0800 (PST) __FILE__ is not guaranteed to exist in current dir. Replace that with argv[0] for memory map test. Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Peter Xu --- tools/testing/selftests/mm/pagemap_ioctl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index befab43719ba..d59517ed3d48 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -36,6 +36,7 @@ int pagemap_fd; int uffd; int page_size; int hpage_size; +const char *progname; #define LEN(region) ((region.end - region.start)/page_size) @@ -1149,11 +1150,11 @@ int sanity_tests(void) munmap(mem, mem_size); /* 9. Memory mapped file */ - fd = open(__FILE__, O_RDONLY); + fd = open(progname, O_RDONLY); if (fd < 0) ksft_exit_fail_msg("%s Memory mapped file\n", __func__); - ret = stat(__FILE__, &sbuf); + ret = stat(progname, &sbuf); if (ret < 0) ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); @@ -1472,12 +1473,14 @@ static void transact_test(int page_size) extra_thread_faults); } -int main(void) +int main(int argc, char *argv[]) { int mem_size, shmid, buf_size, fd, i, ret; char *mem, *map, *fmem; struct stat sbuf; + progname = argv[0]; + ksft_print_header(); if (init_uffd()) -- 2.41.0