linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm/get_user_pages_fast fixes, cleanups
@ 2018-04-05 21:03 Michael S. Tsirkin
  2018-04-05 21:03 ` [PATCH v2 1/3] mm/gup_benchmark: handle gup failures Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2018-04-05 21:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kirill A . Shutemov, Andrew Morton, Huang Ying, Jonathan Corbet,
	Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	Thorsten Leemhuis

Turns out get_user_pages_fast and __get_user_pages_fast return different
values on error when given a single page: __get_user_pages_fast returns
0.  get_user_pages_fast returns either 0 or an error.

Callers of get_user_pages_fast expect an error so fix it up to return an
error consistently.

Stress the difference between get_user_pages_fast and __get_user_pages_fast
to make sure callers aren't confused.

Changes from v1:
	limit code changes to get_user_pages_fast.
	document __get_user_pages_fast
	fix a bug in caller

Michael S. Tsirkin (3):
  mm/gup_benchmark: handle gup failures
  gup: return -EFAULT on access_ok failure
  mm/gup: document return value

 arch/mips/mm/gup.c  | 2 ++
 arch/s390/mm/gup.c  | 2 ++
 arch/sh/mm/gup.c    | 2 ++
 arch/sparc/mm/gup.c | 4 ++++
 mm/gup.c            | 9 +++++++--
 mm/gup_benchmark.c  | 5 +++--
 mm/util.c           | 6 ++++--
 7 files changed, 24 insertions(+), 6 deletions(-)

-- 
MST

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-04-10  0:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 21:03 [PATCH v2 0/3] mm/get_user_pages_fast fixes, cleanups Michael S. Tsirkin
2018-04-05 21:03 ` [PATCH v2 1/3] mm/gup_benchmark: handle gup failures Michael S. Tsirkin
2018-04-07 20:08   ` Linus Torvalds
2018-04-08  3:12     ` Michael S. Tsirkin
2018-04-10  0:38       ` Andrew Morton
2018-04-05 21:03 ` [PATCH v2 2/3] gup: return -EFAULT on access_ok failure Michael S. Tsirkin
2018-04-05 21:03 ` [PATCH v2 3/3] mm/gup: document return value Michael S. Tsirkin
2018-04-06 20:08 ` [PATCH v2 0/3] mm/get_user_pages_fast fixes, cleanups Andrew Morton
2018-04-08  3:08   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).