From patchwork Fri Jul 5 06:54:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominique Martinet X-Patchwork-Id: 1957128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=RUDtxnCS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::43c; helo=mail-pf1-x43c.google.com; envelope-from=swupdate+bncbcwivbv7sugrbnvrt22amgqeqx7plta@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-pf1-x43c.google.com (mail-pf1-x43c.google.com [IPv6:2607:f8b0:4864:20::43c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFkls46z6z1xql for ; Fri, 5 Jul 2024 16:54:49 +1000 (AEST) Received: by mail-pf1-x43c.google.com with SMTP id d2e1a72fcca58-70af548db1esf1127818b3a.0 for ; Thu, 04 Jul 2024 23:54:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720162487; cv=pass; d=google.com; s=arc-20160816; b=q/OPw5d98BGPGg6BawIDDJy0Uv9LCno/wD+2L6Vdk/4jgeNVwZLjm6vNGxnV90j50z geXr0gwbcX46OjtRHb/cz7/4yJa/Yv8Y69+Gug/pevGCvNP0IxOwDYPCkp/QYlnfrCir D+sb+Z3TDDbWhwOW+EGixhBspkoSxvQUTYgCQBlalvIdprPNO7tHM6NVZdufnJP/w+9V vONQGc6VEEBoeruPCE4z52JIZrekxDYmMdqv27tGcLfzk2vJ8VhSoNIZEtb/wU2SjMf6 FpAScwPdDcqyDQx5HUreud2V+jm6qQS7jGVoGyDGrSj3/DCjR/D3az0aDNVZ7WS0Lr9b vpMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=ZtMKKGTRuMhDm2FXfFTT4N5hwBMMa+c8I3LZT2m9YBE=; fh=YUfoV18q0FID5OrymrdDDQhiEhLDfyMrOXaEYnuMTWo=; b=bld1MfueL7fxqSuHw+fFA7yi+njiSBMbfAgWz/pWGOQd4Ub/g5nnYQiBS1Cri4b4Ng HpkpyIhVTDjgmQeHB+hwArrcb5oylt8Igx3LsYMV/MgNJAyq0W6nJkn8aqZVLXi3V/6I GeN+HTPR6EMFGZF3nFaZYA8+dow6H3uZMw+hkmmjA7kaL6K2mD+JqYMU+utvHjg25Nzw +rlv359/QZaOgKU4E13SDRo5fKfxzl/tVKTR0Wtu+22VsVO6JcZN5Jytw98ABjpGr5pU lylIFsJidfwNZV7C6LSDyVu+VpHDW/0Gx7dtwV9kJzVyDbjrj+u8Brka+NrPyjOK1Qhh rh8w==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b="huj+ei/M"; dkim=pass header.i=@atmark-techno.com header.s=google header.b=LQWcg58X; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1720162487; x=1720767287; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=ZtMKKGTRuMhDm2FXfFTT4N5hwBMMa+c8I3LZT2m9YBE=; b=RUDtxnCSoUjYr5sgZP4xAjHgGrTZ0RMkRlvtBWZGY9+2jzj6Ea8ijZ2bkA6pAdeM+2 /LVl2q0X+vxgWzXqGfzCMSA5P+zBjghxdN5a/jI0cN0Eo+4r0Yr0BoUAOwlBFvPclKMr 91shkf7Yw6fDzTAjOsTvq2iDXx4RA5yRKOJ8NPswoqbpuxTbvqfG5X5NcSTBlmpUdYlF Wf2TGsbQUm2xGyAwV37THn7bBLFr0C5chpohVYZacoUyPBGbtvT0H2eGv9ChF5CalWCC zJtml01wvIiTxsP+R7lH2Z5WnojEnxdTtpAHm1jWm/m5pueyz4+FjPKHUAjbgpaNno/5 U1+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720162487; x=1720767287; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=ZtMKKGTRuMhDm2FXfFTT4N5hwBMMa+c8I3LZT2m9YBE=; b=jlwhDVzXmRXyjaBPndoywRMU6tUR2hkq45NUmXp1vIDC5EzmPbUrAsdHL7wdbbkosJ +uBXgxazBZr54Q1kKznRpM8R8xfs1iJ7wVkVu8ddH8YhwZiZkLEHUgmEragw6wUpHIcH 8S9bJTzUHyM9G9X867B6eS4Oe080rcegnIedpH9yK9Bgq84NGB7xZiTh3/P/hqTY8p6q Y6RTwQgzIikz/YAiNMlypGYdYU2rPD3vDEmg2B4LErSjdO/Z1Wi/If7PgOCdDyGMzUuL b0HGjH7MUI2U33OvMQS1llJQfCsxj9wMrBjWdz8D61yovmWkZXiQQvBvlpZNLSShdYBa QbtA== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWyFJcbU71i3SCQ/+diKOAbUFynfLm0yFZBCxABpeI1e/uooSKrL6DlghiFL4+jG31x8U1vrMtvJL+a0JSF8NNUSD2HDAEt9wvPPRkSFw== X-Gm-Message-State: AOJu0Yy5DujHELc/sAJA14U7ANISJak4SDMJXSgUloeDehLhiOcxY9lz pXSYtm+XUq6K4Jw8mS8uBAYzTEyu0PmCKNTQK33P5fr44YyxouEl X-Google-Smtp-Source: AGHT+IGbXFQIQ1s27W/7c4mevTZyUqZCgYh+B3J8A9ZwP8zWrqEAf3d44oeAUsI8adPRl5YwEdwv6g== X-Received: by 2002:a05:6a00:a27:b0:706:1ff1:c5ff with SMTP id d2e1a72fcca58-70b019a5101mr4466495b3a.1.1720162486984; Thu, 04 Jul 2024 23:54:46 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6a00:3c8c:b0:706:6f90:b0fa with SMTP id d2e1a72fcca58-70aff00160els1153865b3a.2.-pod-prod-00-us; Thu, 04 Jul 2024 23:54:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXraVAXbCyr3gKZVlLHlQvW8h/OtKyDpYsnrbdCj7sx695uqLDIrVCjVVwv4gFBn6DjVCQ88eit7/milFAbbTdOUrN9BG3T1eAK X-Received: by 2002:a05:6a20:a11d:b0:1bd:2547:71cd with SMTP id adf61e73a8af0-1c0cd19926fmr5041442637.10.1720162485269; Thu, 04 Jul 2024 23:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720162485; cv=none; d=google.com; s=arc-20160816; b=E0sWi3EnR8d6ddIGQjx6NWbaaxBfaXeo/LhI8JGxX0Tyj9AM00Yp/a3i/UySxANxid VL9AvJZ5+pCUCztn64M68l9AdIt4Af8jowZ9PQ2fokq7UmCxo/r/9FNz/5mm3ohnly15 37fa8HYXReMVgGgzAwSHU5l5GCQqzSvRVulNv8SA4vEpxHc36Avtarw+DQ2Cyz2KXRPE zPq6hMuHWFsXccbkttLDeENM7VXIuAfMWScCy8hCxUC1xlxgHSZ/WpcBf16Yttcn7/SZ NMTZb8Kp4l1i1DOhp9GEqcdy31yD3LK4VTEJUzyGcJt4BeOSOi+9hDh8z6eACm+/PwT8 KiUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=npaLbyIwlsBXB39bX1bgOjZ5RRn7xXQwdH/B3dp9wEc=; fh=pjPBNcNQ/AYb1s50UL3nUE3XbLwPzlW1bKXB3utLwnY=; b=FDQqTl6jEPmrczKwg5yvr3GC1AaxG5JLmc5IaMshRbzVRFVUNIaBjGIn2xLiQm6/+/ bvLcbW6/cyLESLGg9DOLcXvFJMWFu8mECwqAdm5f8jpKqehNLtpnpwNXWL1zA3a0e0cM xYBiijOx0+fcDcKloOB+AbHLLGpKgclTEdNP8tfhQEXXF47FO4f1UIiG/RYpzqtsphKE HW9tNmcr3/BflILkza0QqChPQdeek8M/VQcgFELbhl48M5339TbOCKxR54E0yxaaFWxX mBdDtmWk6jurlobY3gpywg8pJXlUCspLmBiZdaYByjrKwhBmEiKRIRU56HPiX2sEMIG9 T4zQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b="huj+ei/M"; dkim=pass header.i=@atmark-techno.com header.s=google header.b=LQWcg58X; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Received: from gw2.atmark-techno.com (gw2.atmark-techno.com. [35.74.137.57]) by gmr-mx.google.com with ESMTPS id 41be03b00d2f7-72c6a8df9f9si699540a12.2.2024.07.04.23.54.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 23:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) client-ip=35.74.137.57; Received: from gw2.atmark-techno.com (localhost [127.0.0.1]) by gw2.atmark-techno.com (Postfix) with ESMTP id B717047D for ; Fri, 5 Jul 2024 15:54:43 +0900 (JST) Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by gw2.atmark-techno.com (Postfix) with ESMTPS id 561DE372 for ; Fri, 5 Jul 2024 15:54:43 +0900 (JST) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-70af7dc9780so1177803b3a.1 for ; Thu, 04 Jul 2024 23:54:43 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXpuedJ5lmew/HhhWalBsSZkL2uTGYFy5smZBNwZnpeHbnclX9nGLmksdPlX5LjtH0wxMcqwVbM21pa/+U+5K1VD9POb1h+NTXu X-Received: by 2002:a05:6a00:6514:b0:704:3580:8e16 with SMTP id d2e1a72fcca58-70b01bdd3dbmr4635951b3a.17.1720162482311; Thu, 04 Jul 2024 23:54:42 -0700 (PDT) X-Received: by 2002:a05:6a00:6514:b0:704:3580:8e16 with SMTP id d2e1a72fcca58-70b01bdd3dbmr4635933b3a.17.1720162481886; Thu, 04 Jul 2024 23:54:41 -0700 (PDT) Received: from pc-0182.atmarktech (117.209.187.35.bc.googleusercontent.com. [35.187.209.117]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b09ea7c63sm1189046b3a.168.2024.07.04.23.54.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2024 23:54:41 -0700 (PDT) Received: from [::1] (helo=pc-0182.atmark.tech) by pc-0182.atmarktech with esmtp (Exim 4.96) (envelope-from ) id 1sPcq8-00F8cO-1t; Fri, 05 Jul 2024 15:54:40 +0900 From: Dominique Martinet To: stefano.babic@swupdate.org, swupdate@googlegroups.com Cc: Dominique Martinet , James Hilliard Subject: [swupdate] [PATCH 1/5] hawkbit: fix process notification not sending logs Date: Fri, 5 Jul 2024 15:54:30 +0900 Message-Id: <20240705065434.3608030-2-dominique.martinet@atmark-techno.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240705065434.3608030-1-dominique.martinet@atmark-techno.com> References: <20240705065434.3608030-1-dominique.martinet@atmark-techno.com> MIME-Version: 1.0 X-Original-Sender: dominique.martinet@atmark-techno.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b="huj+ei/M"; dkim=pass header.i=@atmark-techno.com header.s=google header.b=LQWcg58X; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , ipc_get_status_timeout() returns the size of the message on success, but ipc_get_status() returns 0 in this case (both return a negative value on error) Changing the function to use ipc_get_status() didn't update the return value check: fix this, and also properly check for errors. Also remove obsolete comment describing the return value. Reported-by: James Hilliard Fixes: da48265ad29f ("suricatta process notification: improve ipc_get_status scheduling") Signed-off-by: Dominique Martinet --- suricatta/server_hawkbit.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 9c3e97418361..26260b6bd5e0 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -1003,7 +1003,12 @@ static void *process_notification_thread(void *data) bool data_avail = false; int ret = ipc_get_status(&msg); - data_avail = ret > 0 && (strlen(msg.data.status.desc) != 0); + if (ret < 0) { + ERROR("Error getting status, stopping notification thread"); + stop = true;; + } else { + data_avail = (strlen(msg.data.status.desc) != 0); + } /* * Mutex used to synchronize end of the thread @@ -1017,12 +1022,6 @@ static void *process_notification_thread(void *data) if (data_avail && msg.data.status.current == PROGRESS) continue; - /* - * If there is a message - * ret > 0: data available - * ret == 0: TIMEOUT, no more messages - * ret < 0 : ERROR, exit - */ if (data_avail && numdetails < MAX_DETAILS) { for (int c = 0; c < strlen(msg.data.status.desc); c++) { switch (msg.data.status.desc[c]) {