Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-10698 obdclass: allow specifying complex jobids
[fs/lustre-release.git]
/
lustre
/
obdclass
/
linux
/
linux-module.c
diff --git
a/lustre/obdclass/linux/linux-module.c
b/lustre/obdclass/linux/linux-module.c
index
4b2d257
..
464d288
100644
(file)
--- a/
lustre/obdclass/linux/linux-module.c
+++ b/
lustre/obdclass/linux/linux-module.c
@@
-481,8
+481,8
@@
static ssize_t jobid_name_show(struct kobject *kobj, struct attribute *attr,
{
int rc = 0;
{
int rc = 0;
- if (strlen(obd_jobid_n
od
e))
- rc = snprintf(buf, PAGE_SIZE, "%s\n", obd_jobid_n
od
e);
+ if (strlen(obd_jobid_n
am
e))
+ rc = snprintf(buf, PAGE_SIZE, "%s\n", obd_jobid_n
am
e);
return rc;
}
return rc;
}
@@
-492,22
+492,23
@@
static ssize_t jobid_name_store(struct kobject *kobj, struct attribute *attr,
if (!count || count > LUSTRE_JOBID_SIZE)
return -EINVAL;
if (!count || count > LUSTRE_JOBID_SIZE)
return -EINVAL;
- if (strcmp(obd_jobid_var, JOBSTATS_NODELOCAL) != 0) {
+ if (strcmp(obd_jobid_var, JOBSTATS_NODELOCAL) != 0 &&
+ !strchr(buffer, '%')) {
lustre_jobid_clear(buffer);
return count;
}
/* clear previous value */
lustre_jobid_clear(buffer);
return count;
}
/* clear previous value */
- memset(obd_jobid_n
od
e, 0, LUSTRE_JOBID_SIZE);
+ memset(obd_jobid_n
am
e, 0, LUSTRE_JOBID_SIZE);
- memcpy(obd_jobid_n
od
e, buffer, count);
+ memcpy(obd_jobid_n
am
e, buffer, count);
/* Trim the trailing '\n' if any */
/* Trim the trailing '\n' if any */
- if (obd_jobid_n
od
e[count - 1] == '\n') {
+ if (obd_jobid_n
am
e[count - 1] == '\n') {
/* Don't echo just a newline */
if (count == 1)
return -EINVAL;
/* Don't echo just a newline */
if (count == 1)
return -EINVAL;
- obd_jobid_n
od
e[count - 1] = 0;
+ obd_jobid_n
am
e[count - 1] = 0;
}
return count;
}
return count;