diff mbox series

pseudo.c: Avoid patch mismatch errors for NAMELESS file entries

Message ID 20230118140047.1924765-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series pseudo.c: Avoid patch mismatch errors for NAMELESS file entries | expand

Commit Message

Richard Purdie Jan. 18, 2023, 2 p.m. UTC
In rare cases we see failures, often in linux-libc-headers for things like:

|   INSTALL /XXX/linux-libc-headers/6.1-r0/image/usr/include
| abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.

Pseudo log:
path mismatch [2 links]: ino 46662476 db 'NAMELESS FILE' req '/XXX/linux-libc-headers/6.1-r0/image/usr'.
Setup complete, sending SIGUSR1 to pid 3630890.

Whilst this doesn't easily reproduce, the issue is that multiple different processes are
likely working on the directory and the creation in pseudo might not match accesses
made by other processes.

Ultimately, the "NAMELESS FILE" is harmless and pseudo will reconcile things
so rather than error out, we should ignore this case.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 pseudo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alexandre Belloni Jan. 18, 2023, 8:59 p.m. UTC | #1
On 18/01/2023 14:00:47+0000, Richard Purdie wrote:
> In rare cases we see failures, often in linux-libc-headers for things like:
> 
> |   INSTALL /XXX/linux-libc-headers/6.1-r0/image/usr/include
> | abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.
> 
> Pseudo log:
> path mismatch [2 links]: ino 46662476 db 'NAMELESS FILE' req '/XXX/linux-libc-headers/6.1-r0/image/usr'.
> Setup complete, sending SIGUSR1 to pid 3630890.
> 
> Whilst this doesn't easily reproduce, the issue is that multiple different processes are
> likely working on the directory and the creation in pseudo might not match accesses
> made by other processes.
> 
> Ultimately, the "NAMELESS FILE" is harmless and pseudo will reconcile things
> so rather than error out, we should ignore this case.
> 

[ YOCTO #14932 ]

> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  pseudo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/pseudo.c b/pseudo.c
> index 528fe1b..4f36786 100644
> --- a/pseudo.c
> +++ b/pseudo.c
> @@ -682,7 +682,8 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
>  				}
>  				break;
>  			default:
> -				if (strcmp(msg->path, path_by_ino)) {
> +				/* Ignore NAMELESS FILE entries since those could be created by other threads on new files */
> +				if (strcmp(msg->path, path_by_ino) && !strcmp(path_by_ino, "NAMELESS FILE")) {
>  					mismatch = 1;
>  				}
>  				break;
> -- 
> 2.37.2
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#176096): https://lists.openembedded.org/g/openembedded-core/message/176096
> Mute This Topic: https://lists.openembedded.org/mt/96354064/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/pseudo.c b/pseudo.c
index 528fe1b..4f36786 100644
--- a/pseudo.c
+++ b/pseudo.c
@@ -682,7 +682,8 @@  pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
 				}
 				break;
 			default:
-				if (strcmp(msg->path, path_by_ino)) {
+				/* Ignore NAMELESS FILE entries since those could be created by other threads on new files */
+				if (strcmp(msg->path, path_by_ino) && !strcmp(path_by_ino, "NAMELESS FILE")) {
 					mismatch = 1;
 				}
 				break;