All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: vishal.l.verma@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH 3/4] ndctl/test: Fix device-dax mremap() test
Date: Tue, 12 Jan 2021 23:15:09 -0800	[thread overview]
Message-ID: <161052210936.1804207.17896246772670985157.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <161052209289.1804207.11599120961607513911.stgit@dwillia2-desk3.amr.corp.intel.com>

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 <dan.j.williams@intel.com>
---
 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");
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  parent reply	other threads:[~2021-01-13  7:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  7:14 [ndctl PATCH 0/4] ndctl/test: softoffline, mremap, and misc fixups Dan Williams
2021-01-13  7:14 ` [ndctl PATCH 1/4] ndctl/test: Fix btt expect table compile warning Dan Williams
2021-01-13  7:15 ` [ndctl PATCH 2/4] ndctl/test: Cleanup unnecessary out label Dan Williams
2021-01-13  7:15 ` Dan Williams [this message]
2021-01-13  7:15 ` [ndctl PATCH 4/4] ndctl/test: Exercise soft_offline_page() corner cases Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161052210936.1804207.17896246772670985157.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.