U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Caleb Connolly <caleb.connolly@linaro.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Ion Agorria <ion@agorria.com>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] fastboot: properly handle unknown partition type
Date: Thu, 14 Nov 2024 14:25:00 +0100	[thread overview]
Message-ID: <87h68aaqxf.fsf@baylibre.com> (raw)
In-Reply-To: <20241113050607.1850472-1-caleb.connolly@linaro.org>

Hi Caleb,

Thank you for the patch.

On mer., nov. 13, 2024 at 06:05, Caleb Connolly <caleb.connolly@linaro.org> wrote:

> In getvar_partition_type() we attempt to find a filesystem driver for
> the partition (of the list of driver enabled in U-Boot), on failure we
> return the error to fastboot and completely bail out of the operation.
>
> However, this should not be a failure, instead we should just default to
> "raw". This allows commands like "fastboot format:ext4 userdata" to work
> if userdata didn't already have an ext4 partition table (or if FS_EXT4
> is disabled in U-Boot), as failing to determine the current partition
> type is not an error in this case.
>
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/fastboot/fb_getvar.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
> index 93cbd598e024..9c2ce65a4e5b 100644
> --- a/drivers/fastboot/fb_getvar.c
> +++ b/drivers/fastboot/fb_getvar.c
> @@ -229,9 +229,10 @@ static void __maybe_unused getvar_partition_type(char *part_name, char *response
>  				       response);
>  	if (r >= 0) {
>  		r = fs_set_blk_dev_with_part(dev_desc, r);
>  		if (r < 0)
> -			fastboot_fail("failed to set partition", response);
> +			/* If we don't know then just default to raw */
> +			fastboot_okay("raw", response);
>  		else
>  			fastboot_okay(fs_get_type_name(), response);
>  	}
>  }
> -- 
> 2.47.0

  reply	other threads:[~2024-11-14 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13  5:05 [PATCH] fastboot: properly handle unknown partition type Caleb Connolly
2024-11-14 13:25 ` Mattijs Korpershoek [this message]
2024-11-19 14:11 ` Mattijs Korpershoek

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=87h68aaqxf.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=caleb.connolly@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=ion@agorria.com \
    --cc=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