]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Report -EFAULT before pwrite fast path into shmemfs
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Oct 2017 20:27:32 +0000 (21:27 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 18 Oct 2017 15:11:35 +0000 (08:11 -0700)
commit9d3dbc5191b135f941cb5c1993ce48a75947e38d
tree6f99aeec9437799e9ecfc490cd43e806b2641db2
parent297e1c33f12d2376b4bb7407aaf7b354e0c3c7f4
drm/i915: Report -EFAULT before pwrite fast path into shmemfs

When pwriting into shmemfs, the fast path pagecache_write does not
notice when it is writing to beyond the end of the truncated shmemfs
inode. Report -EFAULT directly when we try to use pwrite into the
!I915_MADV_WILLNEED object.

Fixes: b8056876b09a ("drm/i915: Use pagecache write to prepopulate shmemfs from pwrite-ioctl")
Testcase: igt/gem_madvise/dontneed-before-pwrite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171016202732.25459-1-chris@chris-wilson.co.uk
(cherry picked from commit a6d65e451cc4e7127698384868a4447ee7be7d16)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/i915_gem.c