Skip to contentSkip to conversation

tmpfs: don't require TEST_DEV

PATCH In review Miklos Szeredi 2 participants 4 messages Sep 3, 2018 – Sep 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tmpfs: don't require TEST_DEV

tmpfs doesn't require a device and the source argument of the mount is ignored. If TEST_DEV is not given then set it to "none".

---
 common/config | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
common/config +6 -1
index 2f1f27206776..40c2b399a3c7 100644
@@ -456,8 +456,9 @@ _check_device()
 	fi
 
 	case "$FSTYP" in
-	9p)
+	9p|tmpfs)
 		# 9p mount tags are just plain strings, so anything is allowed
+		# tmpfs doesn't use mount source, ignore
 		;;
 	overlay)
 		if [ ! -d "$dev" ]; then
@@ -657,6 +658,10 @@ get_next_config() {
 		export RESULT_BASE="$here/results/"
 	fi
 
+	if [ "$FSTYP" == tmpfs -a -z "$TEST_DEV" ]; then
+		export TEST_DEV=none
+	fi
+
 	#  Mandatory Config values.
 	MC=""
 	[ -z "$EMAIL" ]          && MC="$MC EMAIL"
Signature · 1 line
2.14.3
#1 lore raw
Quoted 24 lines · Miklos Szeredi

tmpfs doesn't require a device and the source argument of the mount is ignored. If TEST_DEV is not given then set it to "none".

---
 common/config | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
common/config +2 -1
index 2f1f27206776..40c2b399a3c7 100644
@@ -456,8 +456,9 @@ _check_device()
 	fi
 
 	case "$FSTYP" in
-	9p)
+	9p|tmpfs)
 		# 9p mount tags are just plain strings, so anything is allowed
+		# tmpfs doesn't use mount source, ignore
 		;;
 	overlay)
 		if [ ! -d "$dev" ]; then

common/config get_next_config() { · line 664

Quoted 7 lines
common/config +4 -0
@@ -657,6 +658,10 @@ get_next_config() {
 		export RESULT_BASE="$here/results/"
 	fi
 
+	if [ "$FSTYP" == tmpfs -a -z "$TEST_DEV" ]; then
+		export TEST_DEV=none
+	fi
+

Looks like we could ignore SCRATCH_DEV as well, just set it to a different name. I'll just update it on commit.

Thanks,
Eryu

Quoted 6 lines
common/config +0 -0
 	#  Mandatory Config values.
 	MC=""
 	[ -z "$EMAIL" ]          && MC="$MC EMAIL"
Signature · 1 line
2.14.3
#2 lore raw
Quoted 28 lines · Eryu Guan
Quoted 27 lines · Miklos Szeredi

tmpfs doesn't require a device and the source argument of the mount is ignored. If TEST_DEV is not given then set it to "none".

---
 common/config | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
common/config +2 -1
index 2f1f27206776..40c2b399a3c7 100644
@@ -456,8 +456,9 @@ _check_device()
      fi
 
      case "$FSTYP" in
-     9p)
+     9p|tmpfs)
              # 9p mount tags are just plain strings, so anything is allowed
+             # tmpfs doesn't use mount source, ignore
              ;;
      overlay)
              if [ ! -d "$dev" ]; then
@@ -657,6 +658,10 @@ get_next_config() {
              export RESULT_BASE="$here/results/"
      fi
 
Quoted 7 lines

common/config get_next_config() { · line 664

Quoted 4 lines
common/config +4 -0
+     if [ "$FSTYP" == tmpfs -a -z "$TEST_DEV" ]; then
+             export TEST_DEV=none
+     fi
+

Looks like we could ignore SCRATCH_DEV as well, just set it to a different name. I'll just update it on commit.

Actually, no need to set it to a different name, since the $DEV argument of tmpfs is completely ignored (just like proc, sys, etc).

Thanks,
Miklos

#3 lore raw
Quoted 37 lines · Miklos Szeredi
Quoted 28 lines · Eryu Guan
Quoted 27 lines · Miklos Szeredi

tmpfs doesn't require a device and the source argument of the mount is ignored. If TEST_DEV is not given then set it to "none".

---
 common/config | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
common/config +2 -1
index 2f1f27206776..40c2b399a3c7 100644
@@ -456,8 +456,9 @@ _check_device()
      fi
 
      case "$FSTYP" in
-     9p)
+     9p|tmpfs)
              # 9p mount tags are just plain strings, so anything is allowed
+             # tmpfs doesn't use mount source, ignore
              ;;
      overlay)
              if [ ! -d "$dev" ]; then
@@ -657,6 +658,10 @@ get_next_config() {
              export RESULT_BASE="$here/results/"
      fi
 
Quoted 7 lines

common/config get_next_config() { · line 664

Quoted 4 lines
common/config +4 -0
+     if [ "$FSTYP" == tmpfs -a -z "$TEST_DEV" ]; then
+             export TEST_DEV=none
+     fi
+

Looks like we could ignore SCRATCH_DEV as well, just set it to a different name. I'll just update it on commit.

Quoted 2 lines

Actually, no need to set it to a different name, since the $DEV argument of tmpfs is completely ignored (just like proc, sys, etc).

That's true. But fstests will check if the device is mounted or not based on the device name, so if TEST_DEV is already mounted with "none" and SCRATCH_DEV shares the same name, fstests will find SCRATCH_DEV already mounted at a wrong path and exit.

Thanks,
Eryu