[ndctl,2/4] test/dax.sh: Fix xfs 2M alignment
diff mbox series

Message ID 157150318904.3940762.5575454752395795101.stgit@dwillia2-desk3.amr.corp.intel.com
State New
Headers show
Series
  • test/dax.sh: Add huge page fault validation
Related show

Commit Message

Dan Williams Oct. 19, 2019, 4:39 p.m. UTC
Update the mkfs parameters for the xfs test to ensure 2M aligned
extents, and validate proper alignment in dax-pmd.c.

Link: https://lkml.kernel.org/r/CAPcyv4g2U6YYj6BO_nMgUYPfE2d04pZvKP0JQwNAMy9HZ3UNvg@mail.gmail.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/dax-pmd.c |    3 ++-
 test/dax.sh    |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/test/dax-pmd.c b/test/dax-pmd.c
index 8ed3e9b764f9..0c95b20707c2 100644
--- a/test/dax-pmd.c
+++ b/test/dax-pmd.c
@@ -234,10 +234,11 @@  static int test_pmd(struct ndctl_test *test, int fd)
 
 	for (i = 0; i < map->fm_mapped_extents; i++) {
 		ext = &map->fm_extents[i];
+		p_align = ALIGN(ext->fe_physical, HPAGE_SIZE) - ext->fe_physical;
 		fprintf(stderr, "[%ld]: l: %llx p: %llx len: %llx flags: %x\n",
 				i, ext->fe_logical, ext->fe_physical,
 				ext->fe_length, ext->fe_flags);
-		if (ext->fe_length > 2 * HPAGE_SIZE) {
+		if (ext->fe_length > 2 * HPAGE_SIZE && p_align == 0) {
 			fprintf(stderr, "found potential huge extent\n");
 			break;
 		}
diff --git a/test/dax.sh b/test/dax.sh
index b8eb4ce54e10..59d5eafadae8 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -69,7 +69,7 @@  json=$($NDCTL create-namespace -m raw -f -e $dev)
 eval $(json2var <<< "$json")
 [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
 
-mkfs.xfs -f /dev/$blockdev -m reflink=0
+mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
 run_test $LINENO
@@ -80,7 +80,7 @@  json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
 eval $(json2var <<< "$json")
 [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
 
-mkfs.xfs -f /dev/$blockdev -m reflink=0
+mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
 run_test $LINENO