bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: support for partitioned linux md devices


From: Miquel van Smoorenburg
Subject: Re: support for partitioned linux md devices
Date: Fri, 24 Aug 2012 12:59:47 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]