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-7334 lprocfs: Refactored string to value helpers
[fs/lustre-release.git]
/
lustre
/
obdclass
/
lprocfs_status_server.c
diff --git
a/lustre/obdclass/lprocfs_status_server.c
b/lustre/obdclass/lprocfs_status_server.c
index
6bb6c27
..
d6ee00d
100644
(file)
--- a/
lustre/obdclass/lprocfs_status_server.c
+++ b/
lustre/obdclass/lprocfs_status_server.c
@@
-642,10
+642,11
@@
lprocfs_ir_factor_seq_write(struct file *file, const char __user *buffer,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
- int val, rc;
+ int rc;
+ __s64 val;
LASSERT(obd != NULL);
- rc = lprocfs_
write_helper
(buffer, count, &val);
+ rc = lprocfs_
str_to_s64
(buffer, count, &val);
if (rc)
return rc;
@@
-674,12
+675,15
@@
lprocfs_recovery_time_soft_seq_write(struct file *file,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
- int val, rc;
+ int rc;
+ __s64 val;
LASSERT(obd != NULL);
- rc = lprocfs_
write_helper
(buffer, count, &val);
+ rc = lprocfs_
str_to_s64
(buffer, count, &val);
if (rc)
return rc;
+ if (val < 0 || val > INT_MAX)
+ return -ERANGE;
obd->obd_recovery_timeout = val;
return count;
@@
-703,12
+707,15
@@
lprocfs_recovery_time_hard_seq_write(struct file *file,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
- int val, rc;
+ int rc;
+ __s64 val;
LASSERT(obd != NULL);
- rc = lprocfs_
write_helper
(buffer, count, &val);
+ rc = lprocfs_
str_to_s64
(buffer, count, &val);
if (rc)
return rc;
+ if (val < 0 || val > INT_MAX)
+ return -ERANGE;
obd->obd_recovery_time_hard = val;
return count;