From e88c7c22705f80efca422d30c9fdbc35f9358135 Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Wed, 15 Feb 2023 11:56:36 +0800 Subject: [PATCH] LU-16555 obdclass: print more special chars for jobid Print more YAML compatible special chars for jobid. Currently they are any of ".@-_:/". Lustre-change: https://review.whamcloud.com/49998 Lustre-commit: TBD (from 6117dedfc8823d7b0de0f5912cda18ea16b0d6a7) Test-Parameters: trivial Fixes: 338381574b ("LU-11407 tgt: cleanup job_stats output printing") Signed-off-by: Lei Feng Change-Id: Ic3272b73c95b76ad3171cc7a368a18f804b9aa3e Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50001 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/obdclass/lprocfs_jobstats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lustre/obdclass/lprocfs_jobstats.c b/lustre/obdclass/lprocfs_jobstats.c index 18946e4..d109f08 100644 --- a/lustre/obdclass/lprocfs_jobstats.c +++ b/lustre/obdclass/lprocfs_jobstats.c @@ -443,8 +443,7 @@ static int lprocfs_jobstats_seq_show(struct seq_file *p, void *v) for (c = job->js_jobid, end = job->js_jobid + sizeof(job->js_jobid); c < end && *c != '\0'; c++, joblen++) { - if (!isalnum(*c) && - *c != '.' && *c != '@' && *c != '-' && *c != '_') { + if (!isalnum(*c) && strchr(".@-_:/", *c) == NULL) { quote = "\""; snprintf(escaped + joblen, sizeof(escaped), "\\x%02X", (unsigned char)*c); -- 1.8.3.1