diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 17:49:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 17:49:50 -0400 |
commit | 5166701b368caea89d57b14bf41cf39e819dad51 (patch) | |
tree | c73b9d4860809e3afa9359be9d03ba2d8d98a18e /fs/proc | |
parent | 0a7418f5f569512e98789c439198eed4b507cce3 (diff) | |
parent | a786c06d9f2719203c00b3d97b21f9a96980d0b5 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro:
"The first vfs pile, with deep apologies for being very late in this
window.
Assorted cleanups and fixes, plus a large preparatory part of iov_iter
work. There's a lot more of that, but it'll probably go into the next
merge window - it *does* shape up nicely, removes a lot of
boilerplate, gets rid of locking inconsistencie between aio_write and
splice_write and I hope to get Kent's direct-io rewrite merged into
the same queue, but some of the stuff after this point is having
(mostly trivial) conflicts with the things already merged into
mainline and with some I want more testing.
This one passes LTP and xfstests without regressions, in addition to
usual beating. BTW, readahead02 in ltp syscalls testsuite has started
giving failures since "mm/readahead.c: fix readahead failure for
memoryless NUMA nodes and limit readahead pages" - might be a false
positive, might be a real regression..."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
missing bits of "splice: fix racy pipe->buffers uses"
cifs: fix the race in cifs_writev()
ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure
kill generic_file_buffered_write()
ocfs2_file_aio_write(): switch to generic_perform_write()
ceph_aio_write(): switch to generic_perform_write()
xfs_file_buffered_aio_write(): switch to generic_perform_write()
export generic_perform_write(), start getting rid of generic_file_buffer_write()
generic_file_direct_write(): get rid of ppos argument
btrfs_file_aio_write(): get rid of ppos
kill the 5th argument of generic_file_buffered_write()
kill the 4th argument of __generic_file_aio_write()
lustre: don't open-code kernel_recvmsg()
ocfs2: don't open-code kernel_recvmsg()
drbd: don't open-code kernel_recvmsg()
constify blk_rq_map_user_iov() and friends
lustre: switch to kernel_sendmsg()
ocfs2: don't open-code kernel_sendmsg()
take iov_iter stuff to mm/iov_iter.c
process_vm_access: tidy up a bit
...
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/namespaces.c | 14 | ||||
-rw-r--r-- | fs/proc/self.c | 2 |
2 files changed, 5 insertions, 11 deletions
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index 9ae46b87470d..89026095f2b5 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c | |||
@@ -146,7 +146,7 @@ static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int bufl | |||
146 | struct task_struct *task; | 146 | struct task_struct *task; |
147 | void *ns; | 147 | void *ns; |
148 | char name[50]; | 148 | char name[50]; |
149 | int len = -EACCES; | 149 | int res = -EACCES; |
150 | 150 | ||
151 | task = get_proc_task(inode); | 151 | task = get_proc_task(inode); |
152 | if (!task) | 152 | if (!task) |
@@ -155,24 +155,18 @@ static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int bufl | |||
155 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) | 155 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
156 | goto out_put_task; | 156 | goto out_put_task; |
157 | 157 | ||
158 | len = -ENOENT; | 158 | res = -ENOENT; |
159 | ns = ns_ops->get(task); | 159 | ns = ns_ops->get(task); |
160 | if (!ns) | 160 | if (!ns) |
161 | goto out_put_task; | 161 | goto out_put_task; |
162 | 162 | ||
163 | snprintf(name, sizeof(name), "%s:[%u]", ns_ops->name, ns_ops->inum(ns)); | 163 | snprintf(name, sizeof(name), "%s:[%u]", ns_ops->name, ns_ops->inum(ns)); |
164 | len = strlen(name); | 164 | res = readlink_copy(buffer, buflen, name); |
165 | |||
166 | if (len > buflen) | ||
167 | len = buflen; | ||
168 | if (copy_to_user(buffer, name, len)) | ||
169 | len = -EFAULT; | ||
170 | |||
171 | ns_ops->put(ns); | 165 | ns_ops->put(ns); |
172 | out_put_task: | 166 | out_put_task: |
173 | put_task_struct(task); | 167 | put_task_struct(task); |
174 | out: | 168 | out: |
175 | return len; | 169 | return res; |
176 | } | 170 | } |
177 | 171 | ||
178 | static const struct inode_operations proc_ns_link_inode_operations = { | 172 | static const struct inode_operations proc_ns_link_inode_operations = { |
diff --git a/fs/proc/self.c b/fs/proc/self.c index ffeb202ec942..4348bb8907c2 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c | |||
@@ -16,7 +16,7 @@ static int proc_self_readlink(struct dentry *dentry, char __user *buffer, | |||
16 | if (!tgid) | 16 | if (!tgid) |
17 | return -ENOENT; | 17 | return -ENOENT; |
18 | sprintf(tmp, "%d", tgid); | 18 | sprintf(tmp, "%d", tgid); |
19 | return vfs_readlink(dentry,buffer,buflen,tmp); | 19 | return readlink_copy(buffer, buflen, tmp); |
20 | } | 20 | } |
21 | 21 | ||
22 | static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | 22 | static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) |