summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2018-03-21 19:09:16 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-05 15:13:48 +0100
commitc4a1efae07c30f72eb217d10db37d5708218cf6a (patch)
tree9a3aaca83dedc5058f3454bb64c86af2a4c63d78
parent6026ef7fadf605acc52b6644bef79f148820357e (diff)
downloadpoky-c4a1efae07c30f72eb217d10db37d5708218cf6a.tar.gz
e2fsprogs: fix compatibility with glibc 2.27
glibc 2.27 added function copy_file_range(), and e2fsprogs happens to have a different function with the same name. The conflict made e2fsprogs-native build fail. Here's a backport of a fix from upstream, the fix was released in e2fsprogs 1.43.8. The master branch doesn't need this fix, since it has new enough e2fsprogs version. At least rocko, pyro and morty need this, I haven't checked older stable branches. Apparently the problematic function was introduced in e2fsprogs version 1.43. (From OE-Core rev: d6a297d259d0c4b83f708d4a357c9941c0e478a3) Signed-off-by: Tanu Kaskinen <tanuk@iki.fi> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-rename-copy_file_range-to-copy_file_chunk.patch62
-rw-r--r--meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb1
2 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-rename-copy_file_range-to-copy_file_chunk.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-rename-copy_file_range-to-copy_file_chunk.patch
new file mode 100644
index 0000000000..276432c1a3
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-rename-copy_file_range-to-copy_file_chunk.patch
@@ -0,0 +1,62 @@
1From 10e2247f7b4692e80d185bb65ea641585bdc6b4d Mon Sep 17 00:00:00 2001
2From: Palmer Dabbelt <palmer@dabbelt.com>
3Date: Fri, 29 Dec 2017 10:19:51 -0800
4Subject: [PATCH] misc: rename copy_file_range to copy_file_chunk
5
6As of 2.27, glibc will have a copy_file_range library call to wrap the
7new copy_file_range system call. This conflicts with the function in
8misc/create_inode.c, which this patch renames _copy_file_range.
9
10Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
11Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12
13Upstream-Status: Backport
14
15Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
16---
17 misc/create_inode.c | 8 ++++----
18 1 file changed, 4 insertions(+), 4 deletions(-)
19
20diff --git a/misc/create_inode.c b/misc/create_inode.c
21index c879a3ec..6acf0e20 100644
22--- a/misc/create_inode.c
23+++ b/misc/create_inode.c
24@@ -392,7 +392,7 @@ static ssize_t my_pread(int fd, void *buf, size_t count, off_t offset)
25 }
26 #endif /* !defined HAVE_PREAD64 && !defined HAVE_PREAD */
27
28-static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
29+static errcode_t copy_file_chunk(ext2_filsys fs, int fd, ext2_file_t e2_file,
30 off_t start, off_t end, char *buf,
31 char *zerobuf)
32 {
33@@ -466,7 +466,7 @@ static errcode_t try_lseek_copy(ext2_filsys fs, int fd, struct stat *statbuf,
34
35 data_blk = data & ~(fs->blocksize - 1);
36 hole_blk = (hole + (fs->blocksize - 1)) & ~(fs->blocksize - 1);
37- err = copy_file_range(fs, fd, e2_file, data_blk, hole_blk, buf,
38+ err = copy_file_chunk(fs, fd, e2_file, data_blk, hole_blk, buf,
39 zerobuf);
40 if (err)
41 return err;
42@@ -518,7 +518,7 @@ static errcode_t try_fiemap_copy(ext2_filsys fs, int fd, ext2_file_t e2_file,
43 }
44 for (i = 0, ext = ext_buf; i < fiemap_buf->fm_mapped_extents;
45 i++, ext++) {
46- err = copy_file_range(fs, fd, e2_file, ext->fe_logical,
47+ err = copy_file_chunk(fs, fd, e2_file, ext->fe_logical,
48 ext->fe_logical + ext->fe_length,
49 buf, zerobuf);
50 if (err)
51@@ -569,7 +569,7 @@ static errcode_t copy_file(ext2_filsys fs, int fd, struct stat *statbuf,
52 if (err != EXT2_ET_UNIMPLEMENTED)
53 goto out;
54
55- err = copy_file_range(fs, fd, e2_file, 0, statbuf->st_size, buf,
56+ err = copy_file_chunk(fs, fd, e2_file, 0, statbuf->st_size, buf,
57 zerobuf);
58 out:
59 ext2fs_free_mem(&zerobuf);
60--
612.16.2
62
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
index dcfb564a4b..4eadc3eab4 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
@@ -11,6 +11,7 @@ SRC_URI += "file://acinclude.m4 \
11 file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \ 11 file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
12 file://mkdir_p.patch \ 12 file://mkdir_p.patch \
13 file://0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch \ 13 file://0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch \
14 file://0001-misc-rename-copy_file_range-to-copy_file_chunk.patch \
14" 15"
15 16
16SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch" 17SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch"