From: Michael Heimpold <mhei@heimpold.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tools/fw_env: use fsync to ensure that data is physically stored
Date: Tue, 21 May 2013 19:34:06 +0200 [thread overview]
Message-ID: <456389491.x65y6Gi2JO@kerker> (raw)
In-Reply-To: <20130521124723.D2F42384809@gemini.denx.de>
Hi Wolfgang Denx,
> > Closing a file descriptor does not guarantee that the data has been
> > successfully saved to disk, as the kernel might defer the write.
>
> What is the exact problem you are trying to fix?
>
> I mean, when exactly does adding the sync play a role?
I'm using fw_setenv during system update process. The sequence
of such a shell script is something like (much simplified):
...
fw_setenv state=2
dd if=... of=/dev/mmcblk0...
fw_setenv state=1
...
reboot
The (redundant) environment is stored in a eMMC flash.
The env var 'state' gives a hint to U-Boot whether/where the process
was interrupted.
So my intension is to be absolutely sure, that when fw_setenv returns,
the environment is written out to disk.
Best regards,
Michael
next prev parent reply other threads:[~2013-05-21 17:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 19:34 [U-Boot] [PATCH] tools/fw_env: use fsync to ensure that data is physically stored Michael Heimpold
2013-05-21 12:47 ` Wolfgang Denk
2013-05-21 17:34 ` Michael Heimpold [this message]
2013-05-22 14:32 ` Mats Kärrman
2013-05-22 15:33 ` Mark Jackson
2013-05-22 18:32 ` Michael Heimpold
2017-07-25 0:42 ` [U-Boot] " Tom Rini
-- strict thread matches above, loose matches on Subject: below --
2017-07-13 13:11 [U-Boot] [PATCH] " Vincent Prince
2017-07-14 9:07 ` Vincent Prince
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=456389491.x65y6Gi2JO@kerker \
--to=mhei@heimpold.de \
--cc=u-boot@lists.denx.de \
/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