Whamcloud - gitweb
LU-4563 Fix unsafe userspace access in many proc files
[fs/lustre-release.git] / lustre / osd-zfs / osd_lproc.c
index 8fdd42c..bc8a807 100644 (file)
 #include <obd.h>
 #include <obd_class.h>
 #include <lprocfs_status.h>
-#include <lu_time.h>
-
 #include <lustre/lustre_idl.h>
 
-#include "udmu.h"
 #include "osd_internal.h"
 
 #ifdef LPROCFS
@@ -143,8 +140,8 @@ static int lprocfs_osd_wr_force_sync(struct file *file, const char *buffer,
        return rc == 0 ? count : rc;
 }
 
-static int lprocfs_osd_rd_iused_est(char *page, char **start, off_t off, int count,
-                                       int *eof, void *data)
+static int lprocfs_osd_rd_iused_est(char *page, char **start, off_t off,
+                                   int count, int *eof, void *data)
 {
        struct osd_device *osd = osd_dt_dev((struct dt_device *)data);
        LASSERT(osd != NULL);
@@ -152,8 +149,9 @@ static int lprocfs_osd_rd_iused_est(char *page, char **start, off_t off, int cou
        return snprintf(page, count, "%d\n", osd->od_quota_iused_est);
 }
 
-static int lprocfs_osd_wr_iused_est(struct file *file, const char *buffer,
-                                       unsigned long count, void *data)
+static int lprocfs_osd_wr_iused_est(struct file *file,
+                                   const char __user *buffer,
+                                   unsigned long count, void *data)
 {
        struct osd_device *osd = osd_dt_dev((struct dt_device *)data);
        int                rc, val;
@@ -170,12 +168,12 @@ static int lprocfs_osd_wr_iused_est(struct file *file, const char *buffer,
 }
 
 struct lprocfs_vars lprocfs_osd_obd_vars[] = {
-       { "blocksize",       lprocfs_osd_rd_blksize,     0, 0 },
-       { "kbytestotal",     lprocfs_osd_rd_kbytestotal, 0, 0 },
-       { "kbytesfree",      lprocfs_osd_rd_kbytesfree,  0, 0 },
-       { "kbytesavail",     lprocfs_osd_rd_kbytesavail, 0, 0 },
-       { "filestotal",      lprocfs_osd_rd_filestotal,  0, 0 },
-       { "filesfree",       lprocfs_osd_rd_filesfree,   0, 0 },
+       { "blocksize",          lprocfs_dt_rd_blksize,  0, 0 },
+       { "kbytestotal",        lprocfs_dt_rd_kbytestotal,      0, 0 },
+       { "kbytesfree",         lprocfs_dt_rd_kbytesfree,       0, 0 },
+       { "kbytesavail",        lprocfs_dt_rd_kbytesavail,      0, 0 },
+       { "filestotal",         lprocfs_dt_rd_filestotal,       0, 0 },
+       { "filesfree",          lprocfs_dt_rd_filesfree,        0, 0 },
        { "fstype",          lprocfs_osd_rd_fstype,      0, 0 },
        { "mntdev",          lprocfs_osd_rd_mntdev,      0, 0 },
        { "force_sync",      0, lprocfs_osd_wr_force_sync     },