diff mbox series

[v2] disk: part_dos: update partition table entries after write

Message ID 20210128081007.10587-1-gary.bisson@boundarydevices.com
State Accepted
Commit f14c5ee5ab8bfac0fdbae1143170d8390867479d
Delegated to: Tom Rini
Headers show
Series [v2] disk: part_dos: update partition table entries after write | expand

Commit Message

Gary Bisson Jan. 28, 2021, 8:10 a.m. UTC
Fixes issues when switching from GPT to MBR partition tables.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
Changes for v2:
- added part_init() inside write_mbr_partitions(), as suggested by
  Heinrich
---
 disk/part_dos.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Marek Szyprowski Jan. 28, 2021, 8:18 a.m. UTC | #1
Hi,

On 28.01.2021 09:10, Gary Bisson wrote:
> Fixes issues when switching from GPT to MBR partition tables.
>
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> Changes for v2:
> - added part_init() inside write_mbr_partitions(), as suggested by
>    Heinrich
> ---
>   disk/part_dos.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/disk/part_dos.c b/disk/part_dos.c
> index f431925745c..60addc6e00d 100644
> --- a/disk/part_dos.c
> +++ b/disk/part_dos.c
> @@ -423,6 +423,9 @@ int write_mbr_partitions(struct blk_desc *dev,
>   		ext_part_sect = next_ebr;
>   	}
>   
> +	/* Update the partition table entries*/
> +	part_init(dev_desc);
> +
>   	return 0;
>   }
>   
> @@ -499,6 +502,9 @@ int write_mbr_sector(struct blk_desc *dev_desc, void *buf)
>   		return 1;
>   	}
>   
> +	/* Update the partition table entries*/
> +	part_init(dev_desc);
> +
>   	return 0;
>   }
>   

Best regards
Tom Rini Feb. 2, 2021, 2:31 p.m. UTC | #2
On Thu, Jan 28, 2021 at 09:10:07AM +0100, Gary Bisson wrote:

> Fixes issues when switching from GPT to MBR partition tables.
> 
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

Applied to u-boot/master, thanks!
Da Xue June 22, 2021, 2:48 a.m. UTC | #3
This breaks the build if CONFIG_CMD_MBR is enabled. Christian Melki sent a
patch but it didn't get picked up?

On Tue, Feb 2, 2021 at 9:32 AM Tom Rini <trini@konsulko.com> wrote:

> On Thu, Jan 28, 2021 at 09:10:07AM +0100, Gary Bisson wrote:
>
> > Fixes issues when switching from GPT to MBR partition tables.
> >
> > Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> > Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
> Applied to u-boot/master, thanks!
>
> --
> Tom
>
Tom Rini June 22, 2021, 2:10 p.m. UTC | #4
On Mon, Jun 21, 2021 at 10:48:17PM -0400, Da Xue wrote:

> This breaks the build if CONFIG_CMD_MBR is enabled. Christian Melki sent a
> patch but it didn't get picked up?

Ah.  The commit message wasn't clear that it was reproducible problem
so it was on my list to look at / confirm at some point.  I'll take a
look sooner now, thanks.
diff mbox series

Patch

diff --git a/disk/part_dos.c b/disk/part_dos.c
index f431925745c..60addc6e00d 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -423,6 +423,9 @@  int write_mbr_partitions(struct blk_desc *dev,
 		ext_part_sect = next_ebr;
 	}
 
+	/* Update the partition table entries*/
+	part_init(dev_desc);
+
 	return 0;
 }
 
@@ -499,6 +502,9 @@  int write_mbr_sector(struct blk_desc *dev_desc, void *buf)
 		return 1;
 	}
 
+	/* Update the partition table entries*/
+	part_init(dev_desc);
+
 	return 0;
 }