diff options
Diffstat (limited to 'recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch')
| -rw-r--r-- | recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch b/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch new file mode 100644 index 00000000..dc41d368 --- /dev/null +++ b/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | Upstream-Status: Backport [https://github.com/checkpoint-restore/criu/commit/517c0947] | ||
| 2 | |||
| 3 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 4 | |||
| 5 | From 517c0947050e63aac72f63a3bf373d76264723b9 Mon Sep 17 00:00:00 2001 | ||
| 6 | From: Radostin Stoyanov <rstoyanov@fedoraproject.org> | ||
| 7 | Date: Wed, 24 Aug 2022 21:20:30 +0200 | ||
| 8 | Subject: [PATCH 2/2] mount: add definition for FSOPEN_CLOEXEC | ||
| 9 | |||
| 10 | A recent change in glibc introduced `enum fsconfig_command` [1] and as a | ||
| 11 | result the compilation of criu fails with the following errors | ||
| 12 | |||
| 13 | In file included from criu/pie/util.c:3: | ||
| 14 | /usr/include/sys/mount.h:240:6: error: redeclaration of 'enum fsconfig_command' | ||
| 15 | 240 | enum fsconfig_command | ||
| 16 | | ^~~~~~~~~~~~~~~~ | ||
| 17 | In file included from /usr/include/sys/mount.h:32: | ||
| 18 | criu/include/linux/mount.h:11:6: note: originally defined here | ||
| 19 | 11 | enum fsconfig_command { | ||
| 20 | | ^~~~~~~~~~~~~~~~ | ||
| 21 | /usr/include/sys/mount.h:242:3: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG' | ||
| 22 | 242 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
| 23 | | ^~~~~~~~~~~~~~~~~ | ||
| 24 | criu/include/linux/mount.h:12:9: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command' | ||
| 25 | 12 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
| 26 | | ^~~~~~~~~~~~~~~~~ | ||
| 27 | /usr/include/sys/mount.h:244:3: error: redeclaration of enumerator 'FSCONFIG_SET_STRING' | ||
| 28 | 244 | FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ | ||
| 29 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 30 | criu/include/linux/mount.h:14:9: note: previous definition of 'FSCONFIG_SET_STRING' with type 'enum fsconfig_command' | ||
| 31 | 14 | FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ | ||
| 32 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 33 | /usr/include/sys/mount.h:246:3: error: redeclaration of enumerator 'FSCONFIG_SET_BINARY' | ||
| 34 | 246 | FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ | ||
| 35 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 36 | criu/include/linux/mount.h:16:9: note: previous definition of 'FSCONFIG_SET_BINARY' with type 'enum fsconfig_command' | ||
| 37 | 16 | FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ | ||
| 38 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 39 | /usr/include/sys/mount.h:248:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH' | ||
| 40 | 248 | FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ | ||
| 41 | | ^~~~~~~~~~~~~~~~~ | ||
| 42 | criu/include/linux/mount.h:18:9: note: previous definition of 'FSCONFIG_SET_PATH' with type 'enum fsconfig_command' | ||
| 43 | 18 | FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ | ||
| 44 | | ^~~~~~~~~~~~~~~~~ | ||
| 45 | /usr/include/sys/mount.h:250:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH_EMPTY' | ||
| 46 | 250 | FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ | ||
| 47 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
| 48 | criu/include/linux/mount.h:20:9: note: previous definition of 'FSCONFIG_SET_PATH_EMPTY' with type 'enum fsconfig_command' | ||
| 49 | 20 | FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ | ||
| 50 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
| 51 | /usr/include/sys/mount.h:252:3: error: redeclaration of enumerator 'FSCONFIG_SET_FD' | ||
| 52 | 252 | FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ | ||
| 53 | | ^~~~~~~~~~~~~~~ | ||
| 54 | criu/include/linux/mount.h:22:9: note: previous definition of 'FSCONFIG_SET_FD' with type 'enum fsconfig_command' | ||
| 55 | 22 | FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ | ||
| 56 | | ^~~~~~~~~~~~~~~ | ||
| 57 | /usr/include/sys/mount.h:254:3: error: redeclaration of enumerator 'FSCONFIG_CMD_CREATE' | ||
| 58 | 254 | FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ | ||
| 59 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 60 | criu/include/linux/mount.h:24:9: note: previous definition of 'FSCONFIG_CMD_CREATE' with type 'enum fsconfig_command' | ||
| 61 | 24 | FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ | ||
| 62 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 63 | /usr/include/sys/mount.h:256:3: error: redeclaration of enumerator 'FSCONFIG_CMD_RECONFIGURE' | ||
| 64 | 256 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
| 65 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 66 | criu/include/linux/mount.h:26:9: note: previous definition of 'FSCONFIG_CMD_RECONFIGURE' with type 'enum fsconfig_command' | ||
| 67 | 26 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
| 68 | |||
| 69 | This patch adds definition for FSOPEN_CLOEXEC to solve this problem. In particular, | ||
| 70 | sys/mount.h includes ifndef check for FSOPEN_CLOEXEC surrounding `enum fsconfig_command`. | ||
| 71 | |||
| 72 | [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=7eae6a91e9b1670330c9f15730082c91c0b1d570 | ||
| 73 | |||
| 74 | Reported-by: Younes Manton (@ymanton) | ||
| 75 | Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> | ||
| 76 | --- | ||
| 77 | criu/include/linux/mount.h | 10 ++++++++-- | ||
| 78 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
| 79 | |||
| 80 | diff --git a/criu/include/linux/mount.h b/criu/include/linux/mount.h | ||
| 81 | index 0d55a588c..fefafa89e 100644 | ||
| 82 | --- a/criu/include/linux/mount.h | ||
| 83 | +++ b/criu/include/linux/mount.h | ||
| 84 | @@ -6,7 +6,7 @@ | ||
| 85 | |||
| 86 | /* Copied from /usr/include/sys/mount.h */ | ||
| 87 | |||
| 88 | -#ifndef FSCONFIG_CMD_CREATE | ||
| 89 | +#ifndef FSOPEN_CLOEXEC | ||
| 90 | /* The type of fsconfig call made. */ | ||
| 91 | enum fsconfig_command { | ||
| 92 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
| 93 | @@ -26,7 +26,13 @@ enum fsconfig_command { | ||
| 94 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
| 95 | #define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE | ||
| 96 | }; | ||
| 97 | -#endif // FSCONFIG_CMD_CREATE | ||
| 98 | + | ||
| 99 | +#endif // FSOPEN_CLOEXEC | ||
| 100 | + | ||
| 101 | +/* fsopen flags. With the redundant definition, we check if the kernel, | ||
| 102 | + * glibc value and our value still match. | ||
| 103 | + */ | ||
| 104 | +#define FSOPEN_CLOEXEC 0x00000001 | ||
| 105 | |||
| 106 | #ifndef MS_MGC_VAL | ||
| 107 | /* Magic mount flag number. Has to be or-ed to the flag values. */ | ||
| 108 | -- | ||
| 109 | 2.34.1 | ||
| 110 | |||
