Skip to contentSkip to conversation

drm/i915: set O_LARGEFILE in __create_shmem()

PATCH New Andi Shyti 2 participants 2 messages Sep 15, 2025

Subsystems (2)
lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

PATCH 1/1 drm/i915: set O_LARGEFILE in __create_shmem()

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.

---
Hi,

I'm resending it so that CI picks it up for tests.

Andi

 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +7 -0
index 3b81cc3ad5be..21ea498c59eb 100644
@@ -569,6 +569,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;
 }
Signature · 1 line
2.50.1
#1 lore raw

✓ i915.CI.BAT: success for drm/i915: set O_LARGEFILE in __create_shmem()

== Series Details ==

== Series Details ==

Series: drm/i915: set O_LARGEFILE in __create_shmem()
URL : https://patchwork.freedesktop.org/series/154545/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_17206 -> Patchwork_154545v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/index.html

Participating hosts (44 -> 43)
------------------------------

Missing (1): fi-snb-2520m

Known issues
------------

Here are the changes found in Patchwork_154545v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live:
- bat-jsl-1: [PASS][1] -> [DMESG-FAIL][2] ([i915#13774]) +1 other test dmesg-fail
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-jsl-1/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-jsl-1/igt@[email protected]

* igt@i915_selftest@live@workarounds:
- bat-dg2-14: [PASS][3] -> [DMESG-FAIL][4] ([i915#12061]) +1 other test dmesg-fail
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-dg2-14/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-dg2-14/igt@i915_selftest@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live:
- bat-mtlp-8: [DMESG-FAIL][5] ([i915#12061]) -> [PASS][6] +1 other test pass
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-mtlp-8/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-mtlp-8/igt@[email protected]

* igt@i915_selftest@live@workarounds:
- bat-arls-5: [DMESG-FAIL][7] ([i915#12061]) -> [PASS][8] +1 other test pass
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-arls-5/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-arls-5/igt@i915_selftest@[email protected]
- bat-mtlp-6: [DMESG-FAIL][9] ([i915#12061]) -> [PASS][10] +1 other test pass
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-mtlp-6/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-mtlp-6/igt@i915_selftest@[email protected]

* igt@kms_hdmi_inject@inject-audio:
- fi-tgl-1115g4: [FAIL][11] ([i915#14867]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/fi-tgl-1115g4/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/fi-tgl-1115g4/igt@[email protected]

#### Warnings ####

* igt@i915_selftest@live:
- bat-atsm-1: [DMESG-FAIL][13] ([i915#12061] / [i915#13929]) -> [DMESG-FAIL][14] ([i915#12061] / [i915#14204])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-atsm-1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-atsm-1/igt@[email protected]

* igt@i915_selftest@live@mman:
- bat-atsm-1: [DMESG-FAIL][15] ([i915#13929]) -> [DMESG-FAIL][16] ([i915#14204])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_17206/bat-atsm-1/igt@i915_selftest@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/bat-atsm-1/igt@i915_selftest@[email protected]

[i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
[i915#13774]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13774
[i915#13929]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13929
[i915#14204]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14204
[i915#14867]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14867

Build changes
-------------

* Linux: CI_DRM_17206 -> Patchwork_154545v1

CI-20190529: 20190529
CI_DRM_17206: e42475f2bf04c6af657292d230c411602a0e8aff @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8540: 8540
Patchwork_154545v1: e42475f2bf04c6af657292d230c411602a0e8aff @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_154545v1/index.html