diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 16:44:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 16:44:35 -0400 |
commit | 07e074503eba3ee657ab50a8c9497ddf90039e7e (patch) | |
tree | a2599b466e384d638775f99ebd26a88e13c75b90 | |
parent | 983a5f84a4a11c8706ca70615125db711336b684 (diff) | |
parent | 39dfe6c6a5ce7defc00f11790efb758954042cea (diff) |
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
-rw-r--r-- | arch/xtensa/platforms/iss/simdisk.c | 4 | ||||
-rw-r--r-- | fs/ecryptfs/read_write.c | 9 |
2 files changed, 3 insertions, 10 deletions
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index 0345f43d34f3..fc3c91fd20f7 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c | |||
@@ -217,7 +217,7 @@ static ssize_t proc_read_simdisk(struct file *file, char __user *buf, | |||
217 | size_t size, loff_t *ppos) | 217 | size_t size, loff_t *ppos) |
218 | { | 218 | { |
219 | struct simdisk *dev = PDE_DATA(file_inode(file)); | 219 | struct simdisk *dev = PDE_DATA(file_inode(file)); |
220 | char *s = dev->filename; | 220 | const char *s = dev->filename; |
221 | if (s) { | 221 | if (s) { |
222 | ssize_t n = simple_read_from_buffer(buf, size, ppos, | 222 | ssize_t n = simple_read_from_buffer(buf, size, ppos, |
223 | s, strlen(s)); | 223 | s, strlen(s)); |
@@ -238,7 +238,7 @@ static ssize_t proc_write_simdisk(struct file *file, const char __user *buf, | |||
238 | 238 | ||
239 | if (tmp == NULL) | 239 | if (tmp == NULL) |
240 | return -ENOMEM; | 240 | return -ENOMEM; |
241 | if (copy_from_user(tmp, buffer, count)) { | 241 | if (copy_from_user(tmp, buf, count)) { |
242 | err = -EFAULT; | 242 | err = -EFAULT; |
243 | goto out_free; | 243 | goto out_free; |
244 | } | 244 | } |
diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c index 6a160539cd23..09fe622274e4 100644 --- a/fs/ecryptfs/read_write.c +++ b/fs/ecryptfs/read_write.c | |||
@@ -232,17 +232,10 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size, | |||
232 | struct inode *ecryptfs_inode) | 232 | struct inode *ecryptfs_inode) |
233 | { | 233 | { |
234 | struct file *lower_file; | 234 | struct file *lower_file; |
235 | mm_segment_t fs_save; | ||
236 | ssize_t rc; | ||
237 | |||
238 | lower_file = ecryptfs_inode_to_private(ecryptfs_inode)->lower_file; | 235 | lower_file = ecryptfs_inode_to_private(ecryptfs_inode)->lower_file; |
239 | if (!lower_file) | 236 | if (!lower_file) |
240 | return -EIO; | 237 | return -EIO; |
241 | fs_save = get_fs(); | 238 | return kernel_read(lower_file, offset, data, size); |
242 | set_fs(get_ds()); | ||
243 | rc = vfs_read(lower_file, data, size, &offset); | ||
244 | set_fs(fs_save); | ||
245 | return rc; | ||
246 | } | 239 | } |
247 | 240 | ||
248 | /** | 241 | /** |