Skip to contentSkip to conversation

common/rc: not run swapfile test for DAX

PATCH Superseded [email protected] 2 participants 3 messages Apr 17, 2021 – Apr 23, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/rc: not run swapfile test for DAX

From: root <[email protected]>

DAX doesn't support swapfile. Without this patch, _require_scratch_swapfile always returns fail for fsdax. Now change to notrun.

---
 common/rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
common/rc +5 -1
index 23f86ce6..d02b9f72 100644
@@ -2384,7 +2384,11 @@ _require_scratch_swapfile()
 	ext2|ext3|ext4|xfs)
 		if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then
 			_scratch_unmount
-			_fail "swapon failed for $FSTYP"
+			if _normalize_mount_options | egrep -q "dax(=always| |$)"; then
+				_notrun "swapfiles are not supported"
+			else
+				_fail "swapon failed for $FSTYP"
+			fi
 		fi
 		;;
 	*)
Signature · 1 line
2.27.0
#1 lore raw
Quoted 7 lines · On Sat, Apr 17, 2021 at 12:46:55PM -0400, [email protected] wrote:

From: root <[email protected]>

DAX doesn't support swapfile. Without this patch, _require_scratch_swapfile always returns fail for fsdax. Now change to notrun.

Who?

Quoted 9 lines
---
 common/rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
common/rc +0 -0
index 23f86ce6..d02b9f72 100644

common/rc _require_scratch_swapfile() · line 2387

Quoted 5 lines
common/rc +1 -1
@@ -2384,7 +2384,11 @@ _require_scratch_swapfile()
 	ext2|ext3|ext4|xfs)
 		if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then
 			_scratch_unmount
-			_fail "swapon failed for $FSTYP"
+			if _normalize_mount_options | egrep -q "dax(=always| |$)"; then

Doesn't the STATX_ATTR_DAX test above take care of this?

--D

Quoted 10 lines
common/rc +4 -0
+				_notrun "swapfiles are not supported"
+			else
+				_fail "swapon failed for $FSTYP"
+			fi
 		fi
 		;;
 	*)
Signature · 1 line
2.27.0
#2 lore raw

Hi,

----- Original Message -----

Quoted 9 lines

From: "Darrick J. Wong" <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Sunday, April 18, 2021 12:54:58 AM
Subject: Re: [PATCH v1] common/rc: not run swapfile test for DAX

Quoted 2 lines · On Sat, Apr 17, 2021 at 12:46:55PM -0400, [email protected] wrote:

From: root <[email protected]>

Quoted 7 lines
Quoted 5 lines

DAX doesn't support swapfile. Without this patch, _require_scratch_swapfile always returns fail for fsdax. Now change to notrun.

Who?

Please ignore it. It's added automatically by my client.

Quoted 5 lines
Quoted 5 lines
---
 common/rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 12 lines

common/rc _require_scratch_swapfile() · line 2387

Quoted 10 lines
common/rc +1 -1
index 23f86ce6..d02b9f72 100644
@@ -2384,7 +2384,11 @@ _require_scratch_swapfile()
 	ext2|ext3|ext4|xfs)
 		if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then
 			_scratch_unmount
-			_fail "swapon failed for $FSTYP"
+			if _normalize_mount_options | egrep -q "dax(=always| |$)"; then

Doesn't the STATX_ATTR_DAX test above take care of this?

Yes, need to consider STATX_ATTR_DAX. I will update it.

Thanks.

Quoted 15 lines

--D

Quoted 10 lines
common/rc +4 -1
+				_notrun "swapfiles are not supported"
+			else
+				_fail "swapon failed for $FSTYP"
+			fi
 		fi
 		;;
 	*)
--

2.27.0