Whamcloud - gitweb
LU-7302 scrub: join the running OI scrub properly
[fs/lustre-release.git] / lustre / obdclass / lprocfs_jobstats.c
index af6cc5f..744c0e2 100644 (file)
@@ -647,7 +647,8 @@ lprocfs_job_interval_seq_write(struct file *file, const char __user *buffer,
 {
        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)
@@ -655,9 +656,11 @@ lprocfs_job_interval_seq_write(struct file *file, const char __user *buffer,
 
        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 (val < 0 || val > UINT_MAX)
+               return -ERANGE;
 
        stats->ojs_cleanup_interval = val;
        lprocfs_job_cleanup(stats, stats->ojs_cleanup_interval);