summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch64
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch b/meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch
new file mode 100644
index 0000000000..1737269ec8
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch
@@ -0,0 +1,64 @@
1Rather than mapping mismatched inode entries to paths, thrown an abort()
2instead. Add a new result type to allow the server to pass back
3this instruction to the client.
4
5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6Upstream-Status: Pending
7
8Index: git/pseudo.c
9===================================================================
10--- git.orig/pseudo.c
11+++ git/pseudo.c
12@@ -695,17 +695,15 @@ pseudo_op(pseudo_msg_t *msg, const char
13 msg->path);
14 pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting);
15 } else {
16- int flags = 0;
17- if (msg->nlink > 1) {
18- flags = PDBGF_FILE | PDBGF_VERBOSE;
19- }
20- pseudo_debug(flags, "path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
21+ pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
22 msg->nlink,
23 msg->nlink == 1 ? "" : "s",
24 (unsigned long long) msg_header.ino,
25 path_by_ino ? path_by_ino : "no path",
26 msg->path);
27 found_ino = 0;
28+ msg->result = RESULT_ABORT;
29+ goto op_exit;
30 }
31 }
32 } else {
33@@ -1025,6 +1023,7 @@ pseudo_op(pseudo_msg_t *msg, const char
34 break;
35 }
36
37+op_exit:
38 /* in the case of an exact match, we just used the pointer
39 * rather than allocating space.
40 */
41Index: git/pseudo_client.c
42===================================================================
43--- git.orig/pseudo_client.c
44+++ git/pseudo_client.c
45@@ -1919,6 +1919,10 @@ pseudo_client_op(pseudo_op_t op, int acc
46 #endif
47 if (result) {
48 pseudo_debug(PDBGF_OP, "(%d) %s", getpid(), pseudo_res_name(result->result));
49+ if (result->result == RESULT_ABORT) {
50+ pseudo_diag("abort()ing pseudi client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.\n");
51+ abort();
52+ }
53 if (op == OP_STAT || op == OP_FSTAT) {
54 pseudo_debug(PDBGF_OP, " mode 0%o uid %d:%d",
55 (int) result->mode,
56Index: git/enums/res.in
57===================================================================
58--- git.orig/enums/res.in
59+++ git/enums/res.in
60@@ -2,3 +2,4 @@ res: RESULT
61 succeed
62 fail
63 error
64+abort
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 57c32d0cfc..56c9b4e232 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -4,6 +4,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
4 file://0001-configure-Prune-PIE-flags.patch \ 4 file://0001-configure-Prune-PIE-flags.patch \
5 file://delete_mismatches.patch \ 5 file://delete_mismatches.patch \
6 file://add_ignore_paths.patch \ 6 file://add_ignore_paths.patch \
7 file://abort_on_mismatch.patch \
7 file://fallback-passwd \ 8 file://fallback-passwd \
8 file://fallback-group \ 9 file://fallback-group \
9 " 10 "