Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs fixes from Al Viro: "Regression fix from Geert + yet another open-coded kernel_read()" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ecryptfs: don't open-code kernel_read() xtensa simdisk: Fix proc_create_data() conversion fallout
This commit is contained in:
commit
07e074503e
|
@ -217,7 +217,7 @@ static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
|
||||||
size_t size, loff_t *ppos)
|
size_t size, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct simdisk *dev = PDE_DATA(file_inode(file));
|
struct simdisk *dev = PDE_DATA(file_inode(file));
|
||||||
char *s = dev->filename;
|
const char *s = dev->filename;
|
||||||
if (s) {
|
if (s) {
|
||||||
ssize_t n = simple_read_from_buffer(buf, size, ppos,
|
ssize_t n = simple_read_from_buffer(buf, size, ppos,
|
||||||
s, strlen(s));
|
s, strlen(s));
|
||||||
|
@ -238,7 +238,7 @@ static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,
|
||||||
|
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
if (copy_from_user(tmp, buffer, count)) {
|
if (copy_from_user(tmp, buf, count)) {
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,17 +232,10 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size,
|
||||||
struct inode *ecryptfs_inode)
|
struct inode *ecryptfs_inode)
|
||||||
{
|
{
|
||||||
struct file *lower_file;
|
struct file *lower_file;
|
||||||
mm_segment_t fs_save;
|
|
||||||
ssize_t rc;
|
|
||||||
|
|
||||||
lower_file = ecryptfs_inode_to_private(ecryptfs_inode)->lower_file;
|
lower_file = ecryptfs_inode_to_private(ecryptfs_inode)->lower_file;
|
||||||
if (!lower_file)
|
if (!lower_file)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
fs_save = get_fs();
|
return kernel_read(lower_file, offset, data, size);
|
||||||
set_fs(get_ds());
|
|
||||||
rc = vfs_read(lower_file, data, size, &offset);
|
|
||||||
set_fs(fs_save);
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue