Whamcloud - gitweb
LU-2489 cfs: Use vfs_write() in cfs_user_write()
authorJohn L. Hammond <jhammond@tacc.utexas.edu>
Thu, 13 Dec 2012 18:18:48 +0000 (12:18 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jan 2013 05:22:13 +0000 (00:22 -0500)
cfs_user_write() calls filp->f_op->write() which does not check the
mode of filp.  Call vfs_write() instead.

Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Change-Id: I0cbb2e88d813fe53ce9d625c4299fc5277d246f5
Reviewed-on: http://review.whamcloud.com/4824
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
libcfs/libcfs/linux/linux-fs.c

index 16d76fe..e6f324f 100644 (file)
@@ -74,7 +74,7 @@ cfs_user_write (cfs_file_t *filp, const char *buf, size_t count, loff_t *offset)
        fs = get_fs();
        set_fs(KERNEL_DS);
        while ((ssize_t)count > 0) {
        fs = get_fs();
        set_fs(KERNEL_DS);
        while ((ssize_t)count > 0) {
-               size = filp->f_op->write(filp, (char *)buf, count, offset);
+               size = vfs_write(filp, (const char __user *)buf, count, offset);
                if (size < 0)
                        break;
                count -= size;
                if (size < 0)
                        break;
                count -= size;