Your message dated Tue, 6 Nov 2012 12:25:45 +0000
with message-id <20121106122545.ga32...@riva.dynamic.greenend.org.uk>
and subject line Re: Bug#684713: bug 684713 - support for partitioned MD devices
has caused the Debian Bug report #684713,
regarding parted: support for partitioned MD devices
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
684713: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684713
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: parted
Version: 2.3-10
Severity: serious
Tags: patch wheezy sid

Background: I have added support to the debian installer for installation
on Intel Matrix Raid (imsm) arrays as supported by mdadm (I'll
be submitting patches to debian-boot soon).

When installing on such an array, partitions are created directly
on the array (e.g. /dev/md0). Before kernel 2.6.28, partitionable
md arrays were seperate from 'normal' md arrays (different dev_t's),
but since 2.6.28 that has been consolidated.

However, there is one minor oversight/bug in the kernel: the
sysfs "range" key is still set to "1" for md arrays. That means
libparted thinks that it's not possible to partition that device,
where in fact it is.

The attached patch reckognizes that situation: if running on
a kernel >= 2.6.28, and the device is a PED_DEVICE_MD, and the
sysfs 'range' key is set to '1', _device_get_partition_range()
returns MAX_NUM_PARTS instead.

Please consider this patch for wheezy.

Suggested changelog entry:

  * starting at kernel 2.6.28, MD devices can be partitioned, but the sysfs
    "range" key only shows support for one partition/device. Ignore that
    setting if it's set to "1" and the kernel version is >= 2.6.28.

Mike.
Index: parted-2.3/libparted/arch/linux.c
===================================================================
--- parted-2.3.orig/libparted/arch/linux.c	2010-05-10 10:57:54.000000000 +0000
+++ parted-2.3/libparted/arch/linux.c	2012-08-05 13:24:14.449768577 +0000
@@ -2415,6 +2415,11 @@
         ok = fscanf(fp, "%d", &range) == 1;
         fclose(fp);
 
+	/* starting at 2.6.28 partitions are OK but "range" doesn't show it */
+	if (dev->type == PED_DEVICE_MD && range == 1 &&
+	    _get_linux_version() >= KERNEL_VERSION (2,6,28))
+		ok = 0;
+
         /* (range <= 0) is none sense.*/
         return ok && range > 0 ? range : MAX_NUM_PARTS;
 }

--- End Message ---
--- Begin Message ---
Source: parted
Source-Version: 2.3-11

On Wed, Sep 05, 2012 at 05:27:04PM +0200, Miquel van Smoorenburg wrote:
> Is anyone planning to upload a new parted version to the
> archive anytime soon? If not, I'll probably do an NMU to fix
> bug 684713.

Thanks for this NMU, and sorry for the very delayed response.  I've
pushed your change to our git repository.  Closing this bug now since (I
assume) the earlier BTS snafu meant that it didn't get closed properly
earlier.

-- 
Colin Watson                                       [cjwat...@debian.org]

--- End Message ---

Reply via email to