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-5969 procfs: restore missing newline for version param
[fs/lustre-release.git]
/
lustre
/
obdclass
/
lprocfs_jobstats.c
diff --git
a/lustre/obdclass/lprocfs_jobstats.c
b/lustre/obdclass/lprocfs_jobstats.c
index
cb1157c
..
744c0e2
100644
(file)
--- a/
lustre/obdclass/lprocfs_jobstats.c
+++ b/
lustre/obdclass/lprocfs_jobstats.c
@@
-636,17
+636,19
@@
int lprocfs_job_interval_seq_show(struct seq_file *m, void *data)
return -ENODEV;
stats = &obd->u.obt.obt_jobstats;
return -ENODEV;
stats = &obd->u.obt.obt_jobstats;
- return seq_printf(m, "%d\n", stats->ojs_cleanup_interval);
+ seq_printf(m, "%d\n", stats->ojs_cleanup_interval);
+ return 0;
}
EXPORT_SYMBOL(lprocfs_job_interval_seq_show);
ssize_t
}
EXPORT_SYMBOL(lprocfs_job_interval_seq_show);
ssize_t
-lprocfs_job_interval_seq_write(struct file *file, const char *buffer,
+lprocfs_job_interval_seq_write(struct file *file, const char
__user
*buffer,
size_t count, loff_t *off)
{
struct obd_device *obd;
struct obd_job_stats *stats;
size_t count, loff_t *off)
{
struct obd_device *obd;
struct obd_job_stats *stats;
- int val, rc;
+ int rc;
+ __s64 val;
obd = ((struct seq_file *)file->private_data)->private;
if (obd == NULL)
obd = ((struct seq_file *)file->private_data)->private;
if (obd == NULL)
@@
-654,9
+656,11
@@
lprocfs_job_interval_seq_write(struct file *file, const char *buffer,
stats = &obd->u.obt.obt_jobstats;
stats = &obd->u.obt.obt_jobstats;
- rc = lprocfs_
write_helper
(buffer, count, &val);
+ rc = lprocfs_
str_to_s64
(buffer, count, &val);
if (rc)
return rc;
if (rc)
return rc;
+ if (val < 0 || val > UINT_MAX)
+ return -ERANGE;
stats->ojs_cleanup_interval = val;
lprocfs_job_cleanup(stats, stats->ojs_cleanup_interval);
stats->ojs_cleanup_interval = val;
lprocfs_job_cleanup(stats, stats->ojs_cleanup_interval);