public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/6] env: Fix invalid env handling in env_init()
Date: Fri, 5 Jun 2020 15:07:34 -0400	[thread overview]
Message-ID: <20200605190734.GF24893@bill-the-cat> (raw)
In-Reply-To: <20200603000111.7919-3-marex@denx.de>

On Wed, Jun 03, 2020 at 02:01:08AM +0200, Marek Vasut wrote:

> In case the env storage driver marks environment as ENV_INVALID, we must
> reset the $ret return value to -ENOENT to let the env init code reset the
> environment to the default one a bit further down.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
>  env/env.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/env/env.c b/env/env.c
> index dcc25c030b..024d36fdbe 100644
> --- a/env/env.c
> +++ b/env/env.c
> @@ -300,6 +300,9 @@ int env_init(void)
>  
>  		debug("%s: Environment %s init done (ret=%d)\n", __func__,
>  		      drv->name, ret);
> +
> +		if (gd->env_valid == ENV_INVALID)
> +			ret = -ENOENT;
>  	}
>  
>  	if (!prio)

Is the storage driver marking the environment as invalid but not
returning ENOENT valid?

How does all of this work in the case of multiple configured storage
drivers?

Thanks!

-- 
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/20200605/3fb5ce1f/attachment.sig>

  reply	other threads:[~2020-06-05 19:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  0:01 [PATCH 1/6] env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set Marek Vasut
2020-06-03  0:01 ` [PATCH 2/6] env: Add H_DEFAULT flag Marek Vasut
2020-06-05 19:07   ` Tom Rini
2020-06-03  0:01 ` [PATCH 3/6] env: Fix invalid env handling in env_init() Marek Vasut
2020-06-05 19:07   ` Tom Rini [this message]
2020-06-05 20:47     ` Marek Vasut
2020-06-05 21:11       ` Tom Rini
2020-06-06 14:54         ` Marek Vasut
2020-06-06 16:24           ` Tom Rini
2020-06-08 21:45             ` Marek Vasut
2020-06-08 22:57               ` Tom Rini
2020-06-09  1:50                 ` Marek Vasut
2020-06-09 15:06                   ` Tom Rini
2020-06-03  0:01 ` [PATCH 4/6] env: nowhere: Implement .load callback Marek Vasut
2020-06-05 19:07   ` Tom Rini
2020-06-03  0:01 ` [PATCH 5/6] env: Add option to only ever append environment Marek Vasut
2020-06-05 19:07   ` Tom Rini
2020-06-03  0:01 ` [PATCH 6/6] env: Add support for explicit write access list Marek Vasut
2020-06-05 19:07   ` Tom Rini
2020-06-05 20:48     ` Marek Vasut
2020-06-25 18:12   ` Harald Seiler
2020-06-25 21:42     ` Tom Rini
2020-06-05 19:07 ` [PATCH 1/6] env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set 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=20200605190734.GF24893@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox