Skip to contentSkip to conversation

lib/tst_test.c: set mount_device amd format_device of all_filesystems is set

PATCH New Murphy Zhou 4 participants 9 messages Jun 4, 2019 – Jun 5, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/tst_test.c: set mount_device amd format_device of all_filesystems is set

preadv203.c does not set mount_device, which makes BROK:
preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

Fixing this by format and mount device if all_filesystems is set in library.

---
 lib/tst_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/tst_test.c +4 -1
index 95f389d2e..61dba793e 100644
@@ -808,8 +808,11 @@ static void do_setup(int argc, char *argv[])
 		tst_test->format_device = 1;
 	}
 
-	if (tst_test->all_filesystems)
+	if (tst_test->all_filesystems) {
 		tst_test->needs_device = 1;
+		tst_test->mount_device = 1;
+		tst_test->format_device = 1;
+	}
 
 	setup_ipc();
 
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 lib/tst_test.c: set mount_device amd format_device of all_filesystems is set

Quoted 15 lines · Murphy Zhou

preadv203.c does not set mount_device, which makes BROK:

   preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

Fixing this by format and mount device if all_filesystems is set in library.

---
  lib/tst_test.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
lib/tst_test.c +0 -0
index 95f389d2e..61dba793e 100644

lib/tst_test.c static void do_setup(int argc, char *argv[]) · line 815

Quoted 9 lines
lib/tst_test.c +4 -1
@@ -808,8 +808,11 @@ static void do_setup(int argc, char *argv[])
  		tst_test->format_device = 1;
  	}
 
-	if (tst_test->all_filesystems)
+	if (tst_test->all_filesystems) {
  		tst_test->needs_device = 1;
+		tst_test->mount_device = 1;
+		tst_test->format_device = 1;
+	}

Hi Murph,

1) tst_test->format_device will be set automatically when we set tst_test->mount_device.
2) It's unreasonable to set tst_test->mount_device for all filesystems forcely because we
don't need to mount for all filesystems in some cases(e.g. just test
formating).

Perhaps, you just add tst_test->mount_device in preadv203.c. :-)

Best Regards,
Xiao Yang

Quoted 3 lines
lib/tst_test.c +0 -0
  	setup_ipc();
 
#2 lore raw

PATCH 1/1 lib/tst_test.c: set mount_device amd format_device of all_filesystems is set

Hi,

Quoted 27 lines · Xiao Yang
Quoted 15 lines · Murphy Zhou

preadv203.c does not set mount_device, which makes BROK:

   preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

Fixing this by format and mount device if all_filesystems is set in library.

---
  lib/tst_test.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
lib/tst_test.c +0 -0
index 95f389d2e..61dba793e 100644

lib/tst_test.c static void do_setup(int argc, char *argv[]) · line 815

Quoted 9 lines
lib/tst_test.c +4 -1
@@ -808,8 +808,11 @@ static void do_setup(int argc, char *argv[])
  		tst_test->format_device = 1;
  	}
 
-	if (tst_test->all_filesystems)
+	if (tst_test->all_filesystems) {
  		tst_test->needs_device = 1;
+		tst_test->mount_device = 1;
+		tst_test->format_device = 1;
+	}

Hi Murph,

Quoted 2 lines

1) tst_test->format_device will be set automatically when we set tst_test->mount_device.

Yes. but need to set mount_device in the tcase.

Quoted 4 lines

2) It's unreasonable to set tst_test->mount_device for all filesystems forcely because we
don't need to mount for all filesystems in some cases(e.g. just test
formating).

Good point.

Quoted 2 lines

Perhaps, you just add tst_test->mount_device in preadv203.c. :-)

Yes.. That's I forget to say in the commit message. I just recalled this and then I saw your email :)

Hi Cyril, what do you think? I'm fine with either way.

Thanks,
Murphy

Quoted 9 lines

Best Regards,
Xiao Yang

Quoted 3 lines
lib/tst_test.c +0 -0
  	setup_ipc();
 
#3 lore raw

PATCH v2 1/1 syscalls/preadv2/preadv203: set mount_device flag

Now the tests are running in MOUNTPOINT without it mounted. Fails on ext2:
preadv203.c does not set mount_device, which makes BROK:
preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

---
 testcases/kernel/syscalls/preadv2/preadv203.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/preadv2/preadv203.c +1 -0
index 810d1e8db..e4f68a51b 100644
@@ -261,6 +261,7 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = verify_preadv2,
 	.mntpoint = MNTPOINT,
+	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_tmpdir = 1,
 	.needs_root = 1,
Signature · 1 line
2.21.0
#4 lore raw

PATCH v2 1/1 syscalls/preadv2/preadv203: set mount_device flag

Quoted 2 lines · Murphy Zhou

Now the tests are running in MOUNTPOINT without it mounted. Fails on ext2:

Hi Murphy,

Did you get EOPNOTSUPP when running preadv203 on ext2?

It seems OK to running preadv203 on ext2, as below:
--------------------------------------------------------
tst_test.c:1172: INFO: Testing on ext2
tst_mkfs.c:90: INFO: Formatting /dev/loop0 with ext2 opts='' extra opts='' mke2fs 1.44.3 (10-July-2018)
tst_test.c:1111: INFO: Timeout per run is 0h 05m 00s preadv203.c:145: INFO: Number of full_reads 751044, short reads 10, zero len reads 0, EAGAIN(s) 67021
preadv203.c:180: INFO: Number of writes 1087560 preadv203.c:194: INFO: Cache dropped 149 times preadv203.c:223: PASS: Got some EAGAIN
-------------------------------------------------------

BTW: I got EOPNOTSUPP when running preadv203 on tmpfs. :-)

Best Regards,
Xiao Yang

Quoted 20 lines

preadv203.c does not set mount_device, which makes BROK:
preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

---
 testcases/kernel/syscalls/preadv2/preadv203.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/preadv2/preadv203.c +1 -0
index 810d1e8db..e4f68a51b 100644
@@ -261,6 +261,7 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = verify_preadv2,
 	.mntpoint = MNTPOINT,
+	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_tmpdir = 1,
 	.needs_root = 1,
#5 lore raw

PATCH v2 1/1 syscalls/preadv2/preadv203: set mount_device flag

Quoted 6 lines · Xiao Yang
Quoted 2 lines · Murphy Zhou

Now the tests are running in MOUNTPOINT without it mounted. Fails on ext2:

Hi Murphy,

Did you get EOPNOTSUPP when running preadv203 on ext2?

No, it's running on nfs or cifs exactly.

ext2 is the first one in all_filesystems list.. My commit msg here is confusing. Sending v3.

Quoted 14 lines

It seems OK to running preadv203 on ext2, as below:
--------------------------------------------------------
tst_test.c:1172: INFO: Testing on ext2
tst_mkfs.c:90: INFO: Formatting /dev/loop0 with ext2 opts='' extra opts='' mke2fs 1.44.3 (10-July-2018)
tst_test.c:1111: INFO: Timeout per run is 0h 05m 00s preadv203.c:145: INFO: Number of full_reads 751044, short reads 10, zero len reads 0, EAGAIN(s) 67021
preadv203.c:180: INFO: Number of writes 1087560 preadv203.c:194: INFO: Cache dropped 149 times preadv203.c:223: PASS: Got some EAGAIN
-------------------------------------------------------

Quoted 1 line

BTW: I got EOPNOTSUPP when running preadv203 on tmpfs. :-)

Ya. Thanks for the info!

Murphy

Quoted 26 lines

Best Regards,
Xiao Yang

Quoted 20 lines

preadv203.c does not set mount_device, which makes BROK:
preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

---
 testcases/kernel/syscalls/preadv2/preadv203.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/preadv2/preadv203.c +1 -0
index 810d1e8db..e4f68a51b 100644
@@ -261,6 +261,7 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = verify_preadv2,
 	.mntpoint = MNTPOINT,
+	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_tmpdir = 1,
 	.needs_root = 1,
#6 lore raw

PATCH v3 1/1 syscalls/preadv2/preadv203: set mount_device flag

In reply to Xiao Yang

Now the tests are running in MOUNTPOINT without it mounted. Fails on NFS, cifs, tmpfs:

preadv203.c does not set mount_device, which makes BROK:
preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

---
v3:
improve commit message
v2:
set mount_device in preadv203.c, rather than in the library

 testcases/kernel/syscalls/preadv2/preadv203.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/preadv2/preadv203.c +1 -0
index 810d1e8db..e4f68a51b 100644
@@ -261,6 +261,7 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = verify_preadv2,
 	.mntpoint = MNTPOINT,
+	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_tmpdir = 1,
 	.needs_root = 1,
Signature · 1 line
2.21.0
#7 lore raw

PATCH v3 1/1 syscalls/preadv2/preadv203: set mount_device flag

Hi Murphy,

Pushed. Thanks for your patch. :-)

Best Regards,
Xiao Yang

Quoted 28 lines · Murphy Zhou

Now the tests are running in MOUNTPOINT without it mounted. Fails on NFS, cifs, tmpfs:

preadv203.c does not set mount_device, which makes BROK:
preadv203.c:122: BROK: preadv2() failed: EOPNOTSUPP

---
v3:
improve commit message
v2:
set mount_device in preadv203.c, rather than in the library

 testcases/kernel/syscalls/preadv2/preadv203.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/preadv2/preadv203.c +1 -0
index 810d1e8db..e4f68a51b 100644
@@ -261,6 +261,7 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = verify_preadv2,
 	.mntpoint = MNTPOINT,
+	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_tmpdir = 1,
 	.needs_root = 1,
#8 lore raw

PATCH v3 1/1 syscalls/preadv2/preadv203: set mount_device flag

In reply to Murphy Zhou

Hi!

testcases/kernel/syscalls/preadv2/preadv203.c static struct tst_test test = { · line 267

Quoted 12 lines
testcases/kernel/syscalls/preadv2/preadv203.c +1 -0
index 810d1e8db..e4f68a51b 100644
@@ -261,6 +261,7 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = verify_preadv2,
 	.mntpoint = MNTPOINT,
+	.mount_device = 1,
 	.all_filesystems = 1,
 	.needs_tmpdir = 1,
 	.needs_root = 1,

What a silly mistake of mine, thanks for fixing that.

Unfortunately it seems that this breaks the test on a subset of filesystems. For me it fails when files are written in the test setup, guess that writing 1000 files with 66 blocks of size 4123 is about 236MB is too much for the default 256MB loop device.

I will look into that and send a patch later on.

Signature · 2 lines
Cyril Hrubis
[email protected]