[parted-devel] [PATCH] libparted: remove limits on loop labels

Colin Watson cjwatson at ubuntu.com
Thu Aug 19 10:07:20 UTC 2010


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.
---
 libparted/labels/pt-limit.gperf |    3 ++-
 tests/t9021-maxima.sh           |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

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
 
-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the parted-devel mailing list