Skip to content

Commit 14cb138

Browse files
author
Al Viro
committed
get_user_pages_unlocked(): pass true to __get_user_pages_locked() notify_drop
Equivalent transformation - the only place in __get_user_pages_locked() where we look at notify_drop argument is if (notify_drop && lock_dropped && *locked) { up_read(&mm->mmap_sem); *locked = 0; } in the very end. Changing notify_drop from false to true won't change behaviour unless *locked is non-zero. The caller is ret = __get_user_pages_locked(current, mm, start, nr_pages, pages, NULL, &locked, false, gup_flags | FOLL_TOUCH); if (locked) up_read(&mm->mmap_sem); so in that case the original kernel would have done up_read() right after return from __get_user_pages_locked(), while the modified one would've done it right before the return. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 9a949e8 commit 14cb138

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/gup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
988988

989989
down_read(&mm->mmap_sem);
990990
ret = __get_user_pages_locked(current, mm, start, nr_pages, pages, NULL,
991-
&locked, false, gup_flags | FOLL_TOUCH);
991+
&locked, true, gup_flags | FOLL_TOUCH);
992992
if (locked)
993993
up_read(&mm->mmap_sem);
994994
return ret;

0 commit comments

Comments
 (0)