From: ankur.tyagi85@gmail.com
To: openembedded-core@lists.openembedded.org
Cc: Robert Yang <liezhi.yang@windriver.com>,
Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
Ankur Tyagi <ankur.tyagi85@gmail.com>
Subject: [OE-core][whinlatter][PATCH v2 23/29] e2fsprogs: misc/create_inode.c: Fix for file larger than 2GB
Date: Fri, 19 Dec 2025 08:52:02 +0530 [thread overview]
Message-ID: <20251219032209.960840-24-ankur.tyagi85@gmail.com> (raw)
In-Reply-To: <20251219032209.960840-1-ankur.tyagi85@gmail.com>
From: Robert Yang <liezhi.yang@windriver.com>
Fixed:
$ dd if=/dev/zero of=../image.ext4 bs=1M count=4k
$ dd if=/dev/random of=../rootfs/largefile bs=1M count=3k
$ ./misc/mke2fs -t ext4 -d ../rootfs/ ../image.ext4
__populate_fs: Ext2 file too big while writing file "largefile"
mke2fs: Ext2 file too big while populating file system
This was because the offset is overflow, use __u64 to fix the problem.
Another code which uses ext2_off_t is copy_fs_verity_data(), but it only copies
the metadata, so it should be enough large for it, just leave it there.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 683a1e773899f3042458604b3f136861318c1028)
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
...inode.c-Fix-for-file-larger-than-2GB.patch | 40 +++++++++++++++++++
.../e2fsprogs/e2fsprogs_1.47.3.bb | 1 +
2 files changed, 41 insertions(+)
create mode 100644 meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch
new file mode 100644
index 0000000000..1c578022fb
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch
@@ -0,0 +1,40 @@
+From 6359e0ec8ef249d202dbb8583a6e430f20c5b1a0 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 30 Nov 2025 21:47:50 +0800
+Subject: [PATCH] misc/create_inode.c: Fix for file larger than 2GB
+
+Fixed:
+$ dd if=/dev/zero of=../image.ext4 bs=1M count=4k
+$ dd if=/dev/random of=../rootfs/largefile bs=1M count=3k
+$ ./misc/mke2fs -t ext4 -d ../rootfs/ ../image.ext4
+__populate_fs: Ext2 file too big while writing file "largefile"
+mke2fs: Ext2 file too big while populating file system
+
+This was because the offset is overflow, use __u64 to fix the problem.
+
+Another code which uses ext2_off_t is copy_fs_verity_data(), but it only copies
+the metadata, so it should be enough large for it, just leave it there.
+
+Upstream-Status: Submitted [https://github.com/tytso/e2fsprogs/pull/258]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ misc/create_inode.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 624efc03..14273534 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -414,7 +414,7 @@ static ssize_t my_pread(int fd, void *buf, size_t count, off_t offset)
+ }
+ #endif /* !defined HAVE_PREAD64 && !defined HAVE_PREAD */
+
+-static errcode_t write_all(ext2_file_t e2_file, ext2_off_t off, const char *buf, unsigned int n_bytes) {
++static errcode_t write_all(ext2_file_t e2_file, __u64 off, const char *buf, unsigned int n_bytes) {
+ errcode_t err = ext2fs_file_llseek(e2_file, off, EXT2_SEEK_SET, NULL);
+ if (err)
+ return err;
+--
+2.34.1
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.3.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.3.bb
index 9b5c4dfde5..40658399d9 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.3.bb
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.3.bb
@@ -4,6 +4,7 @@ SRC_URI += "file://remove.ldconfig.call.patch \
file://run-ptest \
file://ptest.patch \
file://mkdir_p.patch \
+ file://0001-misc-create_inode.c-Fix-for-file-larger-than-2GB.patch \
"
SRC_URI:append:class-native = " \
file://e2fsprogs-fix-missing-check-for-permission-denied.patch \
next prev parent reply other threads:[~2025-12-19 3:23 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 3:21 [OE-core][whinlatter][PATCH v2 00/29] Updates for Whinlatter ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 01/29] libxmlb: upgrade 0.3.23 -> 0.3.24 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 02/29] libarchive: upgrade 3.8.2 -> 3.8.3 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 03/29] glib-2.0: Upgrade 2.86.0 -> 2.86.1 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 04/29] ell: upgrade 0.79 -> 0.80 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 05/29] spirv-llvm-translator: Upgrade to 21.1.2 ankur.tyagi85
2025-12-29 17:32 ` Steve Sakoman
2025-12-29 17:49 ` Khem Raj
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 06/29] gst-devtools: upgrade 1.26.5 -> 1.26.7 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 07/29] gst-examples: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 08/29] gstreamer1.0-libav: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 09/29] gstreamer1.0-plugins-bad: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 10/29] gstreamer1.0-plugins-base: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 11/29] gstreamer1.0-plugins-good: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 12/29] gstreamer1.0-plugins-ugly: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 13/29] gstreamer1.0-python: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 14/29] gstreamer1.0-rtsp-server: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 15/29] gstreamer1.0: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 16/29] gstreamer1.0-vaapi: " ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 17/29] go: upgrade 1.25.4 -> 1.25.5 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 18/29] enchant2: upgrade 2.8.12 -> 2.8.14 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 19/29] libpng: upgrade 1.6.50 -> 1.6.51 ankur.tyagi85
2025-12-19 3:21 ` [OE-core][whinlatter][PATCH v2 20/29] llvm/clang: Upgrade to 21.1.6 release ankur.tyagi85
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 21/29] llvm/clang: Upgrade to 21.1.7 release ankur.tyagi85
2025-12-29 20:34 ` Steve Sakoman
2025-12-29 20:41 ` Khem Raj
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 22/29] mesa: upgrade 25.2.5 -> 25.2.8 ankur.tyagi85
2025-12-19 3:22 ` ankur.tyagi85 [this message]
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 24/29] ccache: upgrade 4.12 -> 4.12.1 ankur.tyagi85
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 25/29] ccache: 4.12.1 -> 4.12.2 ankur.tyagi85
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 26/29] gnutls: patch CVE-2025-9820 ankur.tyagi85
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 27/29] cups: upgrade from 2.4.14 to 2.4.15 ankur.tyagi85
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 28/29] sqlite3: patch CVE-2025-3277 ankur.tyagi85
2025-12-19 3:22 ` [OE-core][whinlatter][PATCH v2 29/29] sqlite3: patch CVE-2025-6965 ankur.tyagi85
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219032209.960840-24-ankur.tyagi85@gmail.com \
--to=ankur.tyagi85@gmail.com \
--cc=liezhi.yang@windriver.com \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox