public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 07/28] pseudo: Abort on mismatch patch
Date: Thu,  3 Dec 2020 05:07:57 -1000	[thread overview]
Message-ID: <367cbf64fc97ff39a2a4d109a43b4ecbad7ee69f.1607007208.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1607007208.git.steve@sakoman.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

Rather than doing what turns out to be a rather dangerous "fixup" if
we see a file with a different path but the same inode as another file
we've previously seen, throw and abort. Direct the user to a wiki page
where we can maintain information about what this error means.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2db491d97da08d44ebd257f98489550a82a7935c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 .../pseudo/files/abort_on_mismatch.patch      | 64 +++++++++++++++++++
 meta/recipes-devtools/pseudo/pseudo_git.bb    |  1 +
 2 files changed, 65 insertions(+)
 create mode 100644 meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch

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 @@
+Rather than mapping mismatched inode entries to paths, thrown an abort() 
+instead. Add a new result type to allow the server to pass back
+this instruction to the client.
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Upstream-Status: Pending
+
+Index: git/pseudo.c
+===================================================================
+--- git.orig/pseudo.c
++++ git/pseudo.c
+@@ -695,17 +695,15 @@ pseudo_op(pseudo_msg_t *msg, const char
+ 						msg->path);
+ 					pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting);
+ 				} else {
+-					int flags = 0;
+-					if (msg->nlink > 1) {
+-						flags = PDBGF_FILE | PDBGF_VERBOSE;
+-					}
+-					pseudo_debug(flags, "path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
++					pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
+ 						msg->nlink,
+ 						msg->nlink == 1 ? "" : "s",
+ 						(unsigned long long) msg_header.ino,
+ 						path_by_ino ? path_by_ino : "no path",
+ 						msg->path);
+ 					found_ino = 0;
++					msg->result = RESULT_ABORT;
++					goto op_exit;
+ 				}
+ 			}
+ 		} else {
+@@ -1025,6 +1023,7 @@ pseudo_op(pseudo_msg_t *msg, const char
+ 		break;
+ 	}
+ 
++op_exit:
+ 	/* in the case of an exact match, we just used the pointer
+ 	 * rather than allocating space.
+ 	 */
+Index: git/pseudo_client.c
+===================================================================
+--- git.orig/pseudo_client.c
++++ git/pseudo_client.c
+@@ -1919,6 +1919,10 @@ pseudo_client_op(pseudo_op_t op, int acc
+ #endif
+ 		if (result) {
+ 			pseudo_debug(PDBGF_OP, "(%d) %s", getpid(), pseudo_res_name(result->result));
++			if (result->result == RESULT_ABORT) {
++				pseudo_diag("abort()ing pseudi client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.\n");
++				abort();
++			}
+ 			if (op == OP_STAT || op == OP_FSTAT) {
+ 				pseudo_debug(PDBGF_OP, " mode 0%o uid %d:%d",
+ 					(int) result->mode,
+Index: git/enums/res.in
+===================================================================
+--- git.orig/enums/res.in
++++ git/enums/res.in
+@@ -2,3 +2,4 @@ res: RESULT
+ succeed
+ fail
+ error
++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 \
            file://0001-configure-Prune-PIE-flags.patch \
            file://delete_mismatches.patch \
            file://add_ignore_paths.patch \
+           file://abort_on_mismatch.patch \
            file://fallback-passwd \
            file://fallback-group \
            "
-- 
2.17.1


  parent reply	other threads:[~2020-12-03 15:08 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 15:07 [OE-core][dunfell 00/28] Patch review - pseudo file mode corruption fix series Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 01/28] pseudo: Switch to oe-core branch in git repo Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 02/28] pseudo: merge in fixes for setfacl issue Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 03/28] pseudo: Update to add OFC fcntl lock updates Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 04/28] pseudo: fix renaming to self Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 05/28] pseudo: Ignore mismatched inodes from the db Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 06/28] pseudo: Add support for ignoring paths from the pseudo DB Steve Sakoman
2020-12-03 15:07 ` Steve Sakoman [this message]
2020-12-03 15:07 ` [OE-core][dunfell 08/28] psuedo: Add tracking of linked files for fds Steve Sakoman
2020-12-03 15:07 ` [OE-core][dunfell 09/28] pseudo: Fix xattr segfault Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 10/28] pseudo: Add may unlink patch Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 11/28] pseudo: Add pathfix patch Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 12/28] bitbake.conf: Remove TERM from default BB_HASHBASE_WHITELIST Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 13/28] base/bitbake.conf: Enable pseudo path filtering Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 14/28] wic: Fix permissions when using exclude or include path Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 15/28] wic: Fix multi images .wks with bitbake Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 16/28] wic: Avoid creating invalid pseudo directory Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 17/28] wic: Handle new PSEUDO_IGNORE_PATHS variable Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 18/28] pseudo: Fix statx function usage Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 19/28] devtool: remove unused variable Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 20/28] bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 21/28] abi_version,sanity: Tell users TMPDIR must be clean after pseudo changes Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 22/28] pseudo: Update to account for patches merged on branch Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 23/28] pseudo: Upgrade to include mkostemp64 wrapper Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 24/28] base.bbclass: use os.path.normpath instead of just comparing WORKDIR and S as strings Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 25/28] oeqa/selftest/runtime_test: Exclude gpg directory from pseudo database Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 26/28] tcl: adapt to potential pseudo changes Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 27/28] bitbake.conf: Exclude ${CCACHE_DIR} from pseudo database Steve Sakoman
2020-12-03 15:08 ` [OE-core][dunfell 28/28] uninative: Don't use single sstate for pseudo-native Steve Sakoman
2020-12-21 14:33 ` [OE-core][dunfell 00/28] Patch review - pseudo file mode corruption fix series Martin Jansa
2020-12-21 15:06   ` Steve Sakoman
2020-12-22  9:08     ` Erik Boto
2020-12-22 10:03       ` Richard Purdie
2020-12-22 13:50         ` Paul Barker
2020-12-22 14:57           ` Erik Boto
2020-12-22 15:09             ` Paul Barker
2020-12-22 17:53               ` Richard Purdie

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=367cbf64fc97ff39a2a4d109a43b4ecbad7ee69f.1607007208.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.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