| Message ID | 20261108133615.2483762-2-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Delivered-To: michael@amarulasolutions.com
Received: by 2002:a05:7300:aca6:b0:36a:3487:1c26 with SMTP id
cr38csp1709581dyb;
Sun, 8 Nov 2026 05:36:26 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AL+hErEeyTUHCmaMlXp2d/yRtiu0pBtaHMe8VyCnJtqSWFGDx7BlLEF7yUm0VSmz3jDGWXv46oV+tPBw@amarulasolutions.com
X-Received: by 2002:a05:600c:19d0:b0:4a2:a6e:80f5 with SMTP id
5b1f17b1804b1-4b960d9c5e1mr27517185e9.11.1794144986527;
Sun, 08 Nov 2026 05:36:26 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1794144986; cv=none;
d=google.com; s=arc-20260327;
b=O4Mz2OvVcb/MRZNgJL9b4L0Ff9NCOf5zmYcKagKpCLIFjNAhFlJKNLSFuN23gBwky+
vRes6gGPklGpCOKgOedipsEapx2mbDx0Yafjnnp++1KqsC53wWhLdie9unk5OvT3g/Xb
mzoRZfaxikRxbLlRB0oAo8g4f9Nou58Wk37pllZTqVH6y5VosEBTDl4ohr5EFH1Ac7d8
U4vxkgMCwwMlpuzweCkpjdAZTJVng7KjPsYpnd79ZdFKEwS8U/rnxLWoG5YxQtqjNP7Y
LjD6TijFr2hdCqEX0CZbpKkRzILOIiht6OQzKNYxos8ewB+FIJHYHAN8ipaqpxo4zWSq
3ogg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=bdAN8NQ/3Msuh9sosINkDWY/N5UJ+QWLwYfxfR65s14=;
fh=rgEJXaPld+O5YRSFAH9nIzgwraacrXLFlwsN5VLuJSs=;
b=DuDerworTP4PH1SJtnllYUDpf4MX6Zw0aznmy8MtAyC7GVekCr9cy3R0bnrW1hX2hC
ZVJTSnR+npm0W/hDETQ2ULJp359kDN7HIBwniA7hDibzxTZXYxhhuT6gaXfu3UcU9E9H
jeRNNfWebFKhJv2QT67QRyIhY4CoBl0L4RckOVY1/+fpA5OXtfb3S0DM4axh8BnTdmzU
nLVJVHTIvXEUq6fc8K0N6Z70g0JDNuHbRfXZKa8gvunP8FNzpVBP7PNRxBVMDVqMijLy
AAedQMFX9/WY6b6MhxbteYYb1hpe7gtguCI4uuzF5wrm9OAqQRoZ3qy1gA9JMRfvC58y
HEiw==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=i6nwU7VO;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
Return-Path: <dario.binacchi@amarulasolutions.com>
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
5b1f17b1804b1-4b90ee11554sor2956045e9.14.2026.11.08.05.36.26
for <michael@amarulasolutions.com>
(Google Transport Security);
Sun, 08 Nov 2026 05:36:26 -0800 (PST)
Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
Authentication-Results: mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=i6nwU7VO;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1794144986; x=1794749786;
darn=amarulasolutions.com;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=bdAN8NQ/3Msuh9sosINkDWY/N5UJ+QWLwYfxfR65s14=;
b=i6nwU7VOUwccm7HkxtvjbQrNQZmVJ2U9vS1DBtlMTCAGBxXyCjnEp4WHhdzoyNEqL7
0/SgFXwfum/jWTMfqL6VAX3ml0Zj8WMhcTHoVJYaXITgBus8NnIqI4RIDsK724TdF5tq
2Kl+bK676ABeSxqyK056hjl94jBIeeZs46ZHM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794144986; x=1794749786;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=bdAN8NQ/3Msuh9sosINkDWY/N5UJ+QWLwYfxfR65s14=;
b=JSb/89d1ck/Nkx5MHXS5rx0RaJbM5GZYSUzXBn/xashYfUTd+aaxmBjLjd5q6I0gPp
yW81YeQwhQ9gv/pGxQwyLu98JSc7M6rXZF4Ht+8p5bzyukG+sTW2MbTY6UKuDEYkp4J2
27YxIMJVuw8A5wwixqjb53n2s52rIcpcIyueQ8U/gd1wXlJxc4ltdhXUGd0y/EAm78n0
bXwg5rnIHtidj2CvQH5IB1G9BZ1QvO0H/g4BftXZai7iy54U+NxroOb30RG9lgF9xB3k
8H6aG8Ft81h6KSiOPrtLJBnaH/kTBTcqmBxAMqpZ2ojq6GRt/1OYvWIQJeUmGKV/POHB
vdew==
X-Forwarded-Encrypted: i=1;
AL+hErHYtBogCtEkHV2kxbeKEuMRtPNvWhKIAEvtkfG2pzcz1qo3EJHHMVKqo+lN3Rnq3rGk1wIL2cXc@amarulasolutions.com
X-Gm-Message-State: APuU4Z8S5+NpZTwXCLo43rQdFUxRLZy0Aq3wiuaAZ2y7Dzu2IN2qsSMs
B1IZsndYz/jQ+DyW6xaOgOi7DkKMdfUHsLQB6+gsm4eFmeX3TNwSVxcpQYVxTF6Cw7c51A==
X-Gm-Gg: AYBFou2AFXoGy6y2Gjji3c/a44XBNXa+M5Ak2lz0dgLxVrs3GRJlahW6PHcmE+iZLWB
kqVDyJ1Fced3Kb4q3O+KL3X9Te5NGsSAxP7cg2sSEggdbVMW4fh6K/rTgFvNQnrX0hEgJ5yPo9B
yh8f5pIEBl/iPMcBb4/W4TTWBGNZkARBKWGG19PLjSdbqeRViHZ0AeQgAElpaMoIlqxCcSKnCYr
MrM0OnrHu0qXAxh9O6AhqcwLc0j5Ne7o+xWffhpc71BC85SLO72NjzzDXSjBK5/OY+thaZwvHaG
CFfs6/RbMUgNx+EdueGVZQrMJiMnfbcYYMbb/E+3GvoZxUuD1Y33uHbQxM0kLPvlrG3VnbytrZz
eHNqx80kxRbmJ4CazSFwkZ/BjcdSW9V2waf0i+H6ZBeyUP7kgtjK/ZnAcJRY/FhVP/T6ec+4heS
7pDVVYitZYBRfPnCZEdpOkfmee1qiKfZ+TpdFeRoUdpsjdG8VnwfDyaEiidZiUrBGCXIEHOKxpx
WgivSj62LjwZjI/3xD4ChGud+MbH+sV9J+5LR6814wpAHd3ihYmbEJmvAMSSVEYEUd2AkyTm8So
+2YxWUfztvflhu/sw1A/jJ1+LeQxPO9onHNWI85EelFNlP4Os/HFl3mOHwxeJ++5GNZ0nmE0hIC
vcxWkvS8QSwVJsb0F7w+lQhtOxGFNAUEPY17xrlASOMKDL2vj/HTFMuHvPEmQ8OMiUK2k+22CAq
ujIGamI4WlRAyubagICw5NoiqlKg==
X-Received: by 2002:a05:600c:310e:b0:4a5:a5ca:de1d with SMTP id
5b1f17b1804b1-4b963c7e833mr28954715e9.30.1794144985912;
Sun, 08 Nov 2026 05:36:25 -0800 (PST)
Return-Path: <dario.binacchi@amarulasolutions.com>
Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it
(host-79-14-29-58.business.telecomitalia.it. [79.14.29.58])
by smtp.gmail.com with ESMTPSA id
5b1f17b1804b1-4b76cb76697sm92901945e9.0.2026.11.08.05.36.24
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 08 Nov 2026 05:36:25 -0800 (PST)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: swupdate@googlegroups.com
Cc: stefano.babic@swupdate.org,
linux-amarula@amarulasolutions.com,
michael@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>
Subject: [libubootenv][RFC PATCH 1/4] uboot_env: report fsync errors when
writing to a file
Date: Sun, 8 Nov 2026 14:36:12 +0100
Message-ID: <20261108133615.2483762-2-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20261108133615.2483762-1-dario.binacchi@amarulasolutions.com>
References: <20261108133615.2483762-1-dario.binacchi@amarulasolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
|
| Series |
Add the FWU metadata storage format
|
|
Commit Message
Dario Binacchi
Nov. 8, 2026, 1:36 p.m. UTC
filewrite() ignores the result of fsync(), so an environment that never
reached the storage is reported as stored. Return the error instead.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
src/uboot_env.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.43.0
diff --git a/src/uboot_env.c b/src/uboot_env.c index c6eeb67b607c..d09cb8ead142 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -467,7 +467,8 @@ static int filewrite(struct uboot_flash_env *dev, void *data) } } - fsync(dev->fd); + if (fsync(dev->fd) < 0 && ret >= 0) + ret = -errno; fileprotect(dev, true); // no error handling, keep ret from write