Skip to content

Commit c1e7254

Browse files
Taotao Chentursulin
authored andcommitted
drm/i915: set O_LARGEFILE in __create_shmem()
Without O_LARGEFILE, file->f_op->write_iter calls generic_write_check_limits(), which enforces a 2GB (MAX_NON_LFS) limit, causing -EFBIG on large writes. In shmem_pwrite(), this error is later masked as -EIO due to the error handling order, leading to igt failures like gen9_exec_parse(bb-large). Set O_LARGEFILE in __create_shmem() to prevent -EFBIG on large writes. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Fixes: 048832a ("drm/i915: Refactor shmem_pwrite() to use kiocb and write_iter") Signed-off-by: Taotao Chen <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit e296a22) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 07e27ad commit c1e7254

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/gpu/drm/i915/gem/i915_gem_shmem.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,13 @@ static int __create_shmem(struct drm_i915_private *i915,
514514
if (IS_ERR(filp))
515515
return PTR_ERR(filp);
516516

517+
/*
518+
* Prevent -EFBIG by allowing large writes beyond MAX_NON_LFS on shmem
519+
* objects by setting O_LARGEFILE.
520+
*/
521+
if (force_o_largefile())
522+
filp->f_flags |= O_LARGEFILE;
523+
517524
obj->filp = filp;
518525
return 0;
519526
}

0 commit comments

Comments
 (0)