tracing: do not return EFAULT if read copied anything
authorSteven Rostedt <srostedt@redhat.com>
Thu, 5 Mar 2009 00:10:05 +0000 (19:10 -0500)
committerSteven Rostedt <srostedt@redhat.com>
Thu, 5 Mar 2009 00:10:05 +0000 (19:10 -0500)
Impact: fix trace read to conform to standards

Andrew Morton, Theodore Tso and H. Peter Anvin brought to my attention
that a userspace read should not return -EFAULT if it succeeded in
copying anything. It should only return -EFAULT if it failed to copy
at all.

This patch modifies the check of copy_from_user and updates the return
code appropriately.

I also used H. Peter Anvin's short cut rule to just test ret == count.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>

No differences found