[parted-devel] [PATCH] Ignore devices where we can't create a new PedDisk

David Cantrell dcantrell at redhat.com
Wed Aug 1 18:30:32 UTC 2007


On Wed, 01 Aug 2007 18:24:18 +0200
Jim Meyering <jim at meyering.net> wrote:

> David Cantrell <dcantrell at redhat.com> wrote:
> > The /proc/partitions file is looked at only if /sys/block isn't
> > available.  On my system, I had /sys/block available and there was one
> > node that showed up that caused parted to crash.  That node was md0.
> > There were no software RAID devices on the system at all.  /sys/block/md0
> > was bogus.  But since libparted found it during the device probe, it
> > tried to read a label from it.  Crash.
> 
> Doesn't that mean the label-reading code is at fault?

I don't think so.  For this particular case, the disk label type was unknown, so libparted passed it through all the scanning routines to see if it could figure it out.

> > ...
> 
> Thanks for the details.
> 
> BTW, if you keep that patch on stable-1.8.x, then you should call
> ped_disk_destroy when ped_disk_new succeeds, to avoid leaking.

I revisited this issue today because the reporter (QA guy at Red Hat) indicated that my fix only partly worked and parted was still crashing.  My patch to check the return of ped_disk_new() isn't really what I wanted.  That was removing the disk from the list of detected devices if parted couldn't figure out the disk label type.  That's bad, because then we could never run parted on a disk with an unknown label...that means unpartitioned disks.  :)

Ooops.  So I've removed that and tracked down what the real problem was and have a fix to work around it.  I am fairly certain it's specific to s390x only as that's what the reporter was using and it's the only system type I could reproduce the error on.

Working locally, will post new patches when I have those done.

-- 
David Cantrell <dcantrell at redhat.com>
Red Hat / Westford, MA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20070801/2146427b/attachment-0001.pgp 


More information about the parted-devel mailing list