For hard-links there are many potential races where the path may not
yet exist in the database but we find an inode match on the linked
file. For instance, if one sub-process performs the link and another
one soon after opens the link, it is a race as to which operation's
message is received first by the pseudo server. Therefore, do not
abort on hard links, instead go back to master-branch behavior
(verbose file debug) for such cases.

See commit 691a2304c8c29a3b7d5977908ef82aaf188f5ba0 for original
nerf of the path mismatch messages for hard links.
---
 pseudo.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/pseudo.c b/pseudo.c
index 528fe1b..cb03987 100644
--- a/pseudo.c
+++ b/pseudo.c
@@ -696,15 +696,31 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const 
char *tag, char **respon
                                        pseudo_debug(PDBGF_FILE, "inode 
mismatch for '%s' -- old one was marked for deletion.\n",
                                                msg->path);
                                } else {
-                                       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);
+                                       if (msg->nlink > 1) {
+                                               /* For hard-links there are 
many potential races
+                                                * where the path may not yet 
exist in the
+                                                * database but we find an 
inode match on the
+                                                * linked file. */
+                                               int flags = PDBGF_FILE | 
PDBGF_VERBOSE;
+                                               pseudo_debug(flags, "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);
+                                       } else {
+                                               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;
+                                       if (msg->nlink == 1) {
+                                               msg->result = RESULT_ABORT;
+                                               goto op_exit;
+                                       }
                                }
                        }
                } else {
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164824): 
https://lists.openembedded.org/g/openembedded-core/message/164824
Mute This Topic: https://lists.openembedded.org/mt/90686441/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to