[parted-devel] Re: Patch against SVN (1.8.0rc2): number two

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Tue Oct 31 20:27:15 CET 2006


> > 1. libparted/arch/linux.c -->> a. readFD does not need to allocate
> > 16384 bytes (= 16KB) initially to read /proc/devices. It is merely an
> > ASCII file, which lists the major device numbers of all the devices.
> > It is highly imporabable (if not impossible) for it to be larger than
> > 2KB. The extra memory requirement might lead to a 'memory allocation
> > error/failure' in memory-starved systems. Hence I have shortenend it
> > to 1024 bytes (=1KB).
>
> That function came from nash(8) in RH, which also reads
> /proc/partitions.  That file can definitely get huge on big systems,
> hence the 16KB buffer.  Here it's unnecessary, but doesn't really
> matter.  I'll apply the diff.

Is it the /proc/partitions which can get huge? Or can /proc/devices be
huge too? By the way is there an upper limit for the device major
numbers? I am just curious.

> Thanks for all the fixes!

You are most welcome.

>  I'm going to push out an rc3 here shortly

I am unable to figure out how to use Parted to access LVM volume
groups as a whole, just as the system-config-lvm does on Fedora
systems. I saw that system-config-lvm uses "lvm vgscan --noheaders
--nosuffixes..." to do it.

>  I'd also like
> mention:  Be careful with your ioctl() calls.  If you are making changes
> involving ioctl() calls, be sure to pass arguments if the particular
> ioctl is expecting them.

Ok. Thanks for the advice. Although I have not tinkered with ioctls
till now, I will make sure I am careful when I do so.

Happy hacking,
Debarshi
-- 
"India is not, as people keep calling it, an underdeveloped country,
but rather a developed nation in an advanced state of decay."
--Shashi Tharoor



More information about the parted-devel mailing list