All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] env: increment redund flag on read fail
Date: Mon, 1 Feb 2021 15:54:46 -0500	[thread overview]
Message-ID: <20210201205446.GA2767@bill-the-cat> (raw)
In-Reply-To: <20201217231918.40164-1-brandon.maier@rockwellcollins.com>

On Thu, Dec 17, 2020 at 05:19:18PM -0600, Brandon Maier wrote:

> If one of the reads fails when importing redundant environments (a
> single read failure), the env_flags wouldn't get initialized in
> env_import_redund(). If a user then calls saveenv, the new environment
> will have the wrong flags value. So on the next load the new environment
> will be ignored.
> 
> While debugging this, I also noticed that env/sf.c was not correctly
> handling a single read failure, as it would not check the crc before
> assigning it to gd->env_addr.
> 
> Having a special error path for when there is a single read failure
> seems unnecessary and may lead to future bugs. Instead collapse the
> 'single read failure' error to be the same as a 'single crc failure'.
> That way env_check_redund() either passes or fails, and if it passes we
> are guaranteed to have checked the CRC.
> 
> Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
> CC: Joe Hershberger <joe.hershberger@ni.com>
> CC: Wolfgang Denk <wd@denx.de>
> CC: Heiko Schocher <hs@denx.de>

Sorry for the delay.  Looking this over, yes, I think this is correct
so:

Reviewed-by: Tom Rini <trini@konsulko.com>

And I'm going to give Joe or Wolfgang or Heiko a little more time to
chime in before I apply this in time for v2021.04-rc2.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210201/9ec2185c/attachment.sig>

  reply	other threads:[~2021-02-01 20:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 23:19 [PATCH] env: increment redund flag on read fail Brandon Maier
2021-02-01 20:54 ` Tom Rini [this message]
2021-04-18 12:45 ` Tom Rini

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=20210201205446.GA2767@bill-the-cat \
    --to=trini@konsulko.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.