[parted-devel] Possible Race Condition using test code, libparted, and Fedora 12

Petr Uzel petr.uzel at suse.cz
Thu Jan 7 13:57:19 UTC 2010


On Mon, Jan 04, 2010 at 12:58:25PM -0700, Curtis Gedak wrote:
> Curtis Gedak wrote:
> >I will try out the two patches plus the one you emailed on a
> >pristine copy of parted-1.9.0.  After running my tests I will
> >report back here.
> 
> Unfortunately, my testing of the above quoted situation on Fedora 12
> shows that the test fails on the first iteration.  This failure
> occurred each and every time I ran the test.  Hence this problem is
> still unresolved.

Hm, that doesn't look much better :)

I'm experiencing similar (or maybe the same ?) problem on SUSE with
parted-1.8.8. Sometimes, if I create a partition and immediately
afterwards I try to remove the partition, the kernel doesn't get
informed. The pseudoscript(tm) I'm using:

---
#!/bin/bash
parted -s /dev/sdX mkpart primary 0 10M
parted -s /dev/sdX rm 1
grep /dev/sdX1 /proc/partitions && report error
---

If I run this in a cycle, after several iterations it fails,
because sdX1 is deleted from on-disk table, but it is still
present in /proc/partitions.

It seems to be really sensitive to timing, because if I e.g.
run the 'parted rm' via strace, the probability of failure
decreases significantly.

Idea: something must be touching /dev/sdX1 while parted is
deleting it. So I've put 'lsof /dev/sdX1' between those two
parted calls -> some hal related crap is touching /dev/sdX1.

Now the interesting part: if I run the test with haldaemon
disabled, I'm no longer able to reproduce it.

I know this is far from precise analysis of a problem (and even
further from a solution), but perhaps it might show something
where to look.




-- 
Best regards / s pozdravem

Petr Uzel, openSUSE Boosters Team
-----------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarská 1060/12                          http://www.suse.cz
190 00 Prague 9, CR                             
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20100107/a0d8c13a/attachment.pgp>


More information about the parted-devel mailing list