提交 e5e9ecde 编写于 作者: E Eric Anholt

drm/i915: Correctly set the write flag for get_user_pages in pread.

Otherwise, the results of our read didn't show up when we were faulting in
the page being read into (as happened with a testcase reading into a big
stack area).  Likely accounts for some conformance test failures.
Signed-off-by: NEric Anholt <eric@anholt.net>
上级 2bc43b5c
...@@ -287,7 +287,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj, ...@@ -287,7 +287,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj,
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
pinned_pages = get_user_pages(current, mm, (uintptr_t)args->data_ptr, pinned_pages = get_user_pages(current, mm, (uintptr_t)args->data_ptr,
num_pages, 0, 0, user_pages, NULL); num_pages, 1, 0, user_pages, NULL);
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
if (pinned_pages < num_pages) { if (pinned_pages < num_pages) {
ret = -EFAULT; ret = -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册