Quantcast
Channel: lkml.org : Ganesh Sittampalam
Viewing all articles
Browse latest Browse all 627

Re: [PATCH] gup: return -EFAULT on access_ok failure

$
0
0
Linus Torvalds writes: (Summary) "read()" at past the end of a file is not an error, you'll just get 0 for EOF.
for EOF.
So it's not really "returning 0 on error". That number of pages can be smaller than the requested number of pages, and _that_ is due to some error, but note how it can return "5" on error too - you asked for 10 pages, but the error happened in the middle!
the middle!
So the right way to check for error is to bverify that you get the number of pages that you asked for.

Viewing all articles
Browse latest Browse all 627

Trending Articles