[LTP] [PATCH v2] Improve safe_setxattr error message on ENOTSUP

Andrea Cervesato andrea.cervesato@suse.com
Tue Aug 30 14:38:49 CEST 2022


According with setxattr manual, ENOTSUP is related also with an
invalid namespace/name format.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 lib/safe_macros.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index a5b6bc504..16e582bc9 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -1011,7 +1011,8 @@ int safe_setxattr(const char *file, const int lineno, const char *path,
 	if (rval == -1) {
 		if (errno == ENOTSUP) {
 			tst_brkm_(file, lineno, TCONF, NULL,
-				"no xattr support in fs or mounted without user_xattr option");
+				"no xattr support in fs, mounted without user_xattr option "
+				"or invalid namespace/name format");
 			return rval;
 		}
 
@@ -1037,7 +1038,8 @@ int safe_lsetxattr(const char *file, const int lineno, const char *path,
 	if (rval == -1) {
 		if (errno == ENOTSUP) {
 			tst_brkm_(file, lineno, TCONF, NULL,
-				"no xattr support in fs or mounted without user_xattr option");
+				"no xattr support in fs, mounted without user_xattr option "
+				"or invalid namespace/name format");
 			return rval;
 		}
 
@@ -1063,7 +1065,8 @@ int safe_fsetxattr(const char *file, const int lineno, int fd, const char *name,
 	if (rval == -1) {
 		if (errno == ENOTSUP) {
 			tst_brkm_(file, lineno, TCONF, NULL,
-				"no xattr support in fs or mounted without user_xattr option");
+				"no xattr support in fs, mounted without user_xattr option "
+				"or invalid namespace/name format");
 			return rval;
 		}
 
-- 
2.35.3



More information about the ltp mailing list