Hi Taotao,

Both patches merged to drm-intel-gt-next.

Thank you,
Andi

On Fri, Aug 22, 2025 at 03:06:59AM +0000, 陈涛涛 Taotao Chen wrote:
> From: Taotao Chen <[email protected]>
> 
> 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: 048832a3f400 ("drm/i915: Refactor shmem_pwrite() to use kiocb and 
> write_iter")
> Signed-off-by: Taotao Chen <[email protected]>
> ---
> v2:
>  - Add force_o_largefile() guard before setting O_LARGEFILE
> 
>  drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c 
> b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> index e3d188455f67..b9dae15c1d16 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> @@ -514,6 +514,13 @@ static int __create_shmem(struct drm_i915_private *i915,
>       if (IS_ERR(filp))
>               return PTR_ERR(filp);
>  
> +     /*
> +      * Prevent -EFBIG by allowing large writes beyond MAX_NON_LFS on shmem
> +      * objects by setting O_LARGEFILE.
> +      */
> +     if (force_o_largefile())
> +             filp->f_flags |= O_LARGEFILE;
> +
>       obj->filp = filp;
>       return 0;
>  }
> -- 
> 2.34.1

Reply via email to