On 24-08-12 9:01 AM, Jim Meyering wrote:
However, there is one minor oversight/bug in the kernel: the
sysfs "range" key is still set to "1" for md devices. That means
libparted thinks that it's not possible to partition that device,
when 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.

Thanks for the patch.
FYI, Petr Uzel made the following change in v3.0-61-gca97da9:

     * libparted/arch/linux.c (_device_get_partition_range): Use
     /sys/block/DEV/ext_range instead of range sysfs file

Oh cool, that fixes the same bug. I was working of the debian version so I didn't notice it was already fixed. Sorry for the noise, please discard my patch.

ext_range was added in kernel 2.6.28 (released 25 Dec 2008, almost 4 years ago) - I wonder if using ext_range instead of range should be made conditional depending on KERNEL_VERSION, or are kernels < 2.6.28 sufficiently ancient that it's not worth worrying about? For debian it doesn't really matter I guess.

Mike.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to