Henrik> The code below will return -EINVAL even if some parts of the buffer
Henrik> was successfully read, though.
You mean written? I don't see that. The only place we return -EINVAL is
at the initial check.
Right, it should have been written, and -EFAULT, referring to the code
in the loop.
Henrik