Subject: bug#16229: [PATCH] Sync partitions > 16

From: "Brian C. Lane" <[email-masked]>
Date: Mon, 3 Mar 2014 10:02:05 -0800

On Mon, Dec 23, 2013 at 03:28:22PM -0500, Phillip Susi wrote:
> The linux partition sync code was hard coded to only 16 partitions.
> ---
>  NEWS                   | 3 +++
>  libparted/arch/linux.c | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/NEWS b/NEWS
> index 816fb57..2d0c6b9 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -12,6 +12,9 @@ GNU parted NEWS                                    -*- outline -*-
>    boot partition type.
>  
>  ** Bug Fixes
> +
> +  Fix linux partition sync code to include partitions > 16
> +
>    Fix several bugs with loop labels ( whole disk filesystems )
>  
>    Fix gpt to correctly handle non ASCII charcters in partition names
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index 8a09763..6d3234e 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -1567,6 +1567,7 @@ _flush_cache (PedDevice* dev)
>  {
>          LinuxSpecific*  arch_specific = LINUX_SPECIFIC (dev);
>          int             i;
> +	int             lpn = _device_get_partition_range(dev);
>  
>          if (dev->read_only)
>                  return;
> @@ -1574,7 +1575,7 @@ _flush_cache (PedDevice* dev)
>  
>          ioctl (arch_specific->fd, BLKFLSBUF);
>  
> -        for (i = 1; i < 16; i++) {
> +        for (i = 1; i < lpn; i++) {
>                  char*           name;
>                  int             fd;
>  
> -- 
> 1.8.3.2

Ack. A quick grep shows that this may be the last 16 limit left :)

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)