Colin Watson wrote:
> There's no reason to impose any particular limit on loop labels, since
> they just represent a single large partition.  Sector counts over 2^32
> are needed for large RAID arrays.  Change the limit to 2^64 since that's
> the upper limit imposed by libparted and it saves us implementing the
> limit functions separately.
>
> * libparted/labels/pt-limit.gperf: Change limits on "loop" to 2^64.
> * tests/t9021-maxima.sh: Update for the new loop limit.

Thanks for the patch.
Do you know if this fixes a regression?  I.e., did it ever work?
If so, it might be worthwhile to dig up where the bug
was introduced.

In any case it deserves mention in NEWS,
so I've added that for you below.

I'll push something like the following pretty soon.

>From a1c140475ffc91fa0dfae50b46e861aff98dd9c1 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwat...@ubuntu.com>
Date: Thu, 19 Aug 2010 11:07:20 +0100
Subject: [PATCH] libparted: remove limits on loop labels

There's no reason to impose any particular limit on loop labels, since
they just represent a single large partition.  Sector counts over 2^32
are needed for large RAID arrays.  Change the limit to 2^64 since that's
the upper limit imposed by libparted and it saves us implementing the
limit functions separately.

* libparted/labels/pt-limit.gperf: Change limits on "loop" to 2^64.
* tests/t9021-maxima.sh: Update for the new loop limit.
* NEWS (Bug fixes): Mention it.
---
 NEWS                            |    3 +++
 libparted/labels/pt-limit.gperf |    3 ++-
 tests/t9021-maxima.sh           |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index a1863fc..8eda31c 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ GNU parted NEWS                                    -*- outline 
-*-

 ** Bug fixes

+  libparted: raise the limit on the maximum start sector and the
+  maximum number of sectors in a "loop" partition table from 2^32 to 2^64.
+
   libparted once again recognizes a whole-disk FAT partition
   [bug introduced in parted-1.9.0]

diff --git a/libparted/labels/pt-limit.gperf b/libparted/labels/pt-limit.gperf
index f834647..3d764ae 100644
--- a/libparted/labels/pt-limit.gperf
+++ b/libparted/labels/pt-limit.gperf
@@ -19,7 +19,8 @@ sun,128ULL*UINT32_MAX,UINT32_MAX
 #
 bsd,UINT32_MAX,UINT32_MAX
 # aix,UINT32_MAX,UINT32_MAX
-loop,UINT32_MAX,UINT32_MAX
+# In reality, loop labels have no particular limit.
+loop,UINT64_MAX,UINT64_MAX
 pc98,UINT32_MAX,UINT32_MAX
 #
 # FIXME: not verified.  looks like these are cylinder aligned, too
diff --git a/tests/t9021-maxima.sh b/tests/t9021-maxima.sh
index eb44eea..0f16297 100755
--- a/tests/t9021-maxima.sh
+++ b/tests/t9021-maxima.sh
@@ -42,7 +42,7 @@ for t in msdos gpt dvh sun mac bsd amiga loop pc98; do
     max_start=4294967295
     max_len=4294967295
     case $t in
-       gpt) max_start=18446744073709551615; max_len=$max_start;;
+       gpt|loop) max_start=18446744073709551615; max_len=$max_start;;
        sun) max_start=549755813760;; # 128 * (2^32-1)
     esac

--
1.7.2.1.364.gf88bdb

_______________________________________________
parted-devel mailing list
parted-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to