From patchwork Wed Jan 13 07:15:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 12015919 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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6E1FEC433DB for ; Wed, 13 Jan 2021 07:15:13 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (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 1885923136 for ; Wed, 13 Jan 2021 07:15:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1885923136 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CB403100EB327; Tue, 12 Jan 2021 23:15:12 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=dan.j.williams@intel.com; receiver= Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5A0C9100EB325 for ; Tue, 12 Jan 2021 23:15:10 -0800 (PST) IronPort-SDR: lJmW0lwIEoDFisvKaGsMptzxArfRvE4ZpwUEoXwJWp4bLRGg5Id5SDtiR5wskG13cty496QTtT PPcYPXyghUDQ== X-IronPort-AV: E=McAfee;i="6000,8403,9862"; a="165250663" X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="165250663" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 23:15:09 -0800 IronPort-SDR: WvvCil86LLqhmtJueHzsSnDgcuBsx8a0kxDjsjKyr/heFFE9r6TMZVeWX62m8V8+WabYrWqVuo SP06PoL25bdA== X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="381739835" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 23:15:09 -0800 Subject: [ndctl PATCH 3/4] ndctl/test: Fix device-dax mremap() test From: Dan Williams To: vishal.l.verma@intel.com Date: Tue, 12 Jan 2021 23:15:09 -0800 Message-ID: <161052210936.1804207.17896246772670985157.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <161052209289.1804207.11599120961607513911.stgit@dwillia2-desk3.amr.corp.intel.com> References: <161052209289.1804207.11599120961607513911.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Message-ID-Hash: WMKP5N4EZAP7US3T46CGDK4WGRKLVR7N X-Message-ID-Hash: WMKP5N4EZAP7US3T46CGDK4WGRKLVR7N X-MailFrom: dan.j.williams@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: linux-nvdimm@lists.01.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: The test_dax_remap() test is a regression check for mishandling of mremap() in the presence of pmd_devmap(). My understanding is that it was a fuzzing condition not something an application would want to do in practice. On recent kernels with commit 73d5e0629919 ("mremap: check if it's possible to split original vma"), the test fails for device-dax. That seems an equally acceptable result of attempting this remap, so update the test rather than ask the kernel to preserve the old behaviour. Signed-off-by: Dan Williams --- test/dax-pmd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/dax-pmd.c b/test/dax-pmd.c index b1251db63041..7648e348b0a6 100644 --- a/test/dax-pmd.c +++ b/test/dax-pmd.c @@ -69,6 +69,11 @@ int test_dax_remap(struct ndctl_test *test, int dax_fd, unsigned long align, voi remap = mremap(addr, REMAP_SIZE, REMAP_SIZE, MREMAP_MAYMOVE|MREMAP_FIXED, anon); + if (remap == MAP_FAILED) { + fprintf(stderr, "%s: mremap failed, that's ok too\n", __func__); + return 0; + } + if (remap != anon) { rc = -ENXIO; perror("mremap");