Skip to contentSkip to conversation

syscalls/fsconfig: Improve print messages by adding fsconfig command name

PATCH New Viresh Kumar 2 participants 2 messages Mar 23, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/fsconfig: Improve print messages by adding fsconfig command name

Add fsconfig command name to the print messages to improve readability.

---
 .../kernel/syscalls/fsconfig/fsconfig01.c      | 18 +++++++++---------
 testcases/kernel/syscalls/fsmount/fsmount01.c  |  4 ++--
 testcases/kernel/syscalls/fsmount/fsmount02.c  |  4 ++--
 testcases/kernel/syscalls/fsopen/fsopen01.c    |  4 ++--
 testcases/kernel/syscalls/fspick/fspick.h      |  4 ++--
 testcases/kernel/syscalls/fspick/fspick01.c    |  6 +++---
 .../kernel/syscalls/move_mount/move_mount01.c  |  4 ++--
 .../kernel/syscalls/move_mount/move_mount02.c  |  4 ++--
 .../kernel/syscalls/open_tree/open_tree01.c    |  4 ++--
 .../kernel/syscalls/open_tree/open_tree02.c    |  4 ++--
 10 files changed, 28 insertions(+), 28 deletions(-)
testcases/kernel/syscalls/fsconfig/fsconfig01.c +9 -9
index 34f5481e479a..47941136d502 100644
@@ -28,39 +28,39 @@ static void run(void)
 
 	TEST(fsconfig(fd, FSCONFIG_SET_FLAG, "rw", NULL, 0));
 	if (TST_RET == -1)
-		tst_brk(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_FLAG) failed");
 
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1)
-		tst_brk(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 
 	TEST(fsconfig(fd, FSCONFIG_SET_PATH, "sync", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		if (TST_ERR == EOPNOTSUPP)
-			tst_res(TCONF, "fsconfig(): FSCONFIG_SET_PATH not supported");
+			tst_res(TCONF, "fsconfig(FSCONFIG_SET_PATH) not supported");
 		else
-			tst_brk(TFAIL | TTERRNO, "fsconfig() failed");
+			tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_PATH) failed");
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_SET_PATH_EMPTY, "sync", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		if (TST_ERR == EOPNOTSUPP)
-			tst_res(TCONF, "fsconfig(): FSCONFIG_SET_PATH_EMPTY not supported");
+			tst_res(TCONF, "fsconfig(FSCONFIG_SET_PATH_EMPTY) not supported");
 		else
-			tst_brk(TFAIL | TTERRNO, "fsconfig() failed");
+			tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_PATH_EMPTY) failed");
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_SET_FD, "sync", NULL, 0));
 	if (TST_RET == -1) {
 		if (TST_ERR == EOPNOTSUPP)
-			tst_res(TCONF, "fsconfig(): FSCONFIG_SET_FD not supported");
+			tst_res(TCONF, "fsconfig(FSCONFIG_SET_FD) not supported");
 		else
-			tst_brk(TFAIL | TTERRNO, "fsconfig() failed");
+			tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_FD) failed");
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1)
-		tst_brk(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 
 	TEST(fsmfd = fsmount(fd, 0, 0));
 	if (fsmfd == -1)
testcases/kernel/syscalls/fsmount/fsmount01.c +2 -2
index 34d9365d4680..e8198187145b 100644
@@ -52,14 +52,14 @@ static void run(unsigned int n)
 	if (TST_RET == -1) {
 		SAFE_CLOSE(sfd);
 		tst_res(TFAIL | TTERRNO,
-			"fsconfig() failed to set source to %s", tst_device->dev);
+			"fsconfig(FSCONFIG_SET_STRING) failed to set source to %s", tst_device->dev);
 		return;
 	}
 
 	TEST(fsconfig(sfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(sfd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() created superblock");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 		return;
 	}
 
testcases/kernel/syscalls/fsmount/fsmount02.c +2 -2
index 6f90519ff5f7..effc863516b6 100644
@@ -39,11 +39,11 @@ static void setup(void)
 
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1)
-		tst_brk(TBROK | TTERRNO, "fsconfig() failed");
+		tst_brk(TBROK | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1)
-		tst_brk(TBROK | TTERRNO, "fsconfig() failed");
+		tst_brk(TBROK | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 }
 
 static void run(unsigned int n)
testcases/kernel/syscalls/fsopen/fsopen01.c +2 -2
index 02e6d270eff3..8dabd6814a93 100644
@@ -33,13 +33,13 @@ static void run(unsigned int n)
 
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1) {
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 		goto out;
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 		goto out;
 	}
 
testcases/kernel/syscalls/fspick/fspick.h +2 -2
index ca84269ee7a9..4be296ee79da 100644
@@ -29,13 +29,13 @@ static void setup(void)
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_brk(TBROK | TERRNO, "fsconfig() failed");
+		tst_brk(TBROK | TERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_brk(TBROK | TERRNO, "fsconfig() failed");
+		tst_brk(TBROK | TERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 	}
 
 	TEST(fsmfd = fsmount(fd, 0, 0));
testcases/kernel/syscalls/fspick/fspick01.c +3 -3
index b5a35bf61e2c..c84723805cb9 100644
@@ -33,19 +33,19 @@ static void run(unsigned int n)
 
 	TEST(fsconfig(fspick_fd, FSCONFIG_SET_STRING, "sync", "false", 0));
 	if (TST_RET == -1) {
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 		goto out;
 	}
 
 	TEST(fsconfig(fspick_fd, FSCONFIG_SET_FLAG, "ro", NULL, 0));
 	if (TST_RET == -1) {
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_FLAG) failed");
 		goto out;
 	}
 
 	TEST(fsconfig(fspick_fd, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0));
 	if (TST_RET == -1) {
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_RECONFIGURE) failed");
 		goto out;
 	}
 
testcases/kernel/syscalls/move_mount/move_mount01.c +2 -2
index ede88946ad4c..fd785da02b14 100644
@@ -37,14 +37,14 @@ static void run(unsigned int n)
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 		return;
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 		return;
 	}
 
testcases/kernel/syscalls/move_mount/move_mount02.c +2 -2
index 74c287b0a6fb..f75991a3f5d2 100644
@@ -41,14 +41,14 @@ static void run(unsigned int n)
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 		return;
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 		return;
 	}
 
testcases/kernel/syscalls/open_tree/open_tree01.c +2 -2
index 905d16a03697..ddaabed810bd 100644
@@ -49,14 +49,14 @@ static void run(unsigned int n)
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 		return;
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_res(TFAIL | TTERRNO, "fsconfig() failed");
+		tst_res(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 		return;
 	}
 
testcases/kernel/syscalls/open_tree/open_tree02.c +2 -2
index 58c71da20e74..76a750ae412b 100644
@@ -42,13 +42,13 @@ static void setup(void)
 	TEST(fsconfig(fd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_brk(TBROK | TTERRNO, "fsconfig() failed");
+		tst_brk(TBROK | TTERRNO, "fsconfig(FSCONFIG_SET_STRING) failed");
 	}
 
 	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
 	if (TST_RET == -1) {
 		SAFE_CLOSE(fd);
-		tst_brk(TBROK | TTERRNO, "fsconfig() failed");
+		tst_brk(TBROK | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
 	}
 
 	TEST(fsmfd = fsmount(fd, 0, 0));
Signature · 1 line
2.21.0.rc0.269.g1a574e7a288b
#1 lore raw

PATCH 1/1 syscalls/fsconfig: Improve print messages by adding fsconfig command name

Hi Viresh,

Quoted 1 line

Add fsconfig command name to the print messages to improve readability.

Thanks, merged.

Kind regards,
Petr