Error handling broken for block devices

Stephen Warren swarren at wwwdotorg.org
Mon Jan 20 21:16:32 CET 2020


On 1/20/20 9:40 AM, Wolfgang Denk wrote:
> Hi,
> 
> I noticed that block device commands like "ls" fail to give any error
> messages in some cases.  For example, something like
> 
> 	-> ls FOOBAR 1:1 /
> 	->
> 
> will terminate without the slightest hint that FOOBAR is some device
> type it does not know.
...
> No error messages get printed here, but I think these are mandatory
> in such a case.
> 
> 
> Stephen, this code was added as part of your commit:
> 
> commit 10a37fd7a40826c43a63591855346adf1a1ac02d
> Author: Stephen Warren <swarren at nvidia.com>
> Date:   Fri Sep 21 09:50:57 2012 +0000
> 
>     disk: get_device_and_partition() "auto" partition and cleanup
> 
> 
> Can you think of any strong reason _not_ to issue a proper error
> message here?

No, this path should definitely print an error message somewhere.

It's possible that when this command was originally implemented, some
nested function printed an error, such that the command implementation
itself didn't too, to avoid duplication. Or maybe I just forgot to add
the error print.


More information about the U-Boot mailing list