From: Alex Kiernan Date: Fri, 9 Mar 2018 12:12:58 +0000 Subject: [U-Boot] [PATCH v2 0/4] Add atomic write to fw_setenv for environments on filesystems Message-ID: <1520597582-12979-1-git-send-email-alex.kiernan@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de For environments stored on filesystems where you can't have a redundant configuration, rather than just over-writing the existing environment in fw_setenv, do the tradtional create temporary file, rename, sync, sync directory dance to achieve ACID semantics when writing through fw_setenv. fw_env.c has had whitespace modified and HaveRedundEnv renamed in order to avoid triggering large numbers of checkpatch warnings because of the existing code style: warning: space prohibited between function name and open parenthesis '(' check: Avoid CamelCase: Changes in v2: - Clean style violations in existing code - Acommodate white space changes from predecessor commit - Use mkstemp() to create temporary filename, not a fixed one Alex Kiernan (4): tools: env: Pass through indent tools: env: Fix CamelCasing style violation tools: env: Refactor write path of flash_io() tools: env: Implement atomic replace for filesystem tools/env/fw_env.c | 483 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 281 insertions(+), 202 deletions(-) -- 2.7.4