u-boot/disk
Sam Protsenko ac0cd5267f part: Check all partitions in part_get_info_by_name()
In part_get_info_by_name() the inability to get some partition info
shouldn't be a reason for dropping out of the loop. That might happen
e.g. if the partition is hidden or unused. An example of such case are
Samsung devices, where they use the "unused" GUID type
(00000000-0000-0000-0000-000000000000) to indicate that the partition
should be hidden from the OS. Such partitions might not be seen in
"part list" output, which creates "gaps" in numbering in between of the
visible partitions:

    Part    Start LBA       End LBA         Name
      1     0x00000400      0x0000a3ff      "efs"
      5     0x00026420      0x00026c1f      "dtbo"
     12     0x0003f390      0x0074738f      "super"

In that case, the loop in part_get_info_by_name() would break after
partition #1, so any attempt to obtain "dtbo" or "super" partition will
fail. Fix that by continuing to iterate over the remaining partitions to
make sure none of the visible ones is missed. That makes "part" command
(e.g. "part start", "part size") able to work with such tables.

Fixes: 87b8530fe2 ("disk: part: implement generic function part_get_info_by_name()")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-04-12 08:53:31 -06:00
..
disk-uclass.c disk: Move part_create_block_devices() to blk uclass 2023-08-22 15:17:52 -04:00
Kconfig disk: Use BOOT_DEFAULTS instead of DISTRO_DEFAULTS 2023-07-17 15:38:11 -04:00
Makefile blk: Rename HAVE_BLOCK_DEVICE 2022-09-16 11:05:16 -04:00
part.c part: Check all partitions in part_get_info_by_name() 2024-04-12 08:53:31 -06:00
part_amiga.c part: amiga: Use desc instead of dev_desc 2023-08-25 17:55:18 -04:00
part_amiga.h global: Drop common.h inclusion 2023-12-21 08:54:37 -05:00
part_dos.c cmd: mbr: Allow 4 MBR partitions without need for extended 2023-10-24 17:05:24 -04:00
part_dos.h disk: dos: add code for creating MBR partition layout 2021-01-15 15:33:09 -05:00
part_efi.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
part_iso.c part: iso: Use desc instead of dev_desc 2023-08-25 17:55:18 -04:00
part_iso.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
part_mac.c part: nac: Use desc instead of dev_desc 2023-08-25 17:55:18 -04:00
part_mac.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00