Bug 516096 - Race condition in test_swapon_label_0: /sbin/blockdev: BLKRRPART: Device or resource busy
Summary: Race condition in test_swapon_label_0: /sbin/blockdev: BLKRRPART: Device or r...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-06 17:35 UTC by Richard W.M. Jones
Modified: 2010-05-21 11:33 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-05-12 15:14:09 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2009-08-06 17:35:28 UTC
Description of problem:

Test fails sometimes with:

/sbin/swapoff -L swapit
psock_read_event: 0x26d2010 g->state = 3, fd = 3, events = 0x1
roc 175 (swapoff_label) took 0.07 seconds
sock_read_event: 0x26d2010 g->state = 3, fd = 3, events = 0x1
sock_write_event: 0x26d2010 g->state = 3, fd = 3, events = 0x2
sock_write_event: writing 40 bytes ...
sock_write_event: wrote 40 bytes
sock_write_event: done writing, calling send_cb
sock_read_event: 0x26d2010 g->state = 3, fd = 3, events = 0x1
proc 85 (zero) took 0.03 seconds
sock_read_event: 0x26d2010 g->state = 3, fd = 3, events = 0x1
sock_write_event: 0x26d2010 g->state = 3, fd = 3, events = 0x2
sock_write_event: writing 40 bytes ...
sock_write_event: wrote 40 bytes
sock_write_event: done writing, calling send_cb
/sbin/blockdev --rereadpt /dev/sdb
guestfsd: error: /sbin/blockdev: BLKRRPART: Device or resource busy
proc 65 (blockdev_rereadpt) took 0.09 seconds
sock_read_event: 0x26d2010 g->state = 3, fd = 3, events = 0x1
sock_read_event: 0x26d2010 g->state = 3, fd = 3, events = 0x1
/sbin/blockdev: BLKRRPART: Device or resource busy
test_swapon_label_0 FAILED

The proximate cause is this commit:

http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=8eb7f1a58f424ad0f210fe638574b5067d2ac97b

However the underlying reason is that the swapoff operation
doesn't finish before the BLKRRPART ioctl is performed.

In the past we have sometimes seen good effects by adding
calls to udev_settle() at places in the code, although we
don't know if that works just by luck/timing.

Comment 1 Richard W.M. Jones 2010-05-12 11:24:46 UTC
This bug has just reappeared in the build.

Comment 2 Richard W.M. Jones 2010-05-12 15:14:09 UTC
I added this which hopefully will fix the problem:
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=9d158c3ab132df21d58890f18224cd2fe020de67

Comment 3 Fedora Update System 2010-05-14 19:12:47 UTC
libguestfs-1.2.6-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.6-1.fc13

Comment 4 Fedora Update System 2010-05-17 12:27:56 UTC
libguestfs-1.2.7-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-1.fc12

Comment 5 Fedora Update System 2010-05-17 12:47:46 UTC
libguestfs-1.2.7-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-1.el5

Comment 6 Fedora Update System 2010-05-17 13:00:25 UTC
libguestfs-1.2.7-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-2.fc13

Comment 7 Fedora Update System 2010-05-21 11:33:40 UTC
libguestfs-1.2.7-2.fc13.1 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-2.fc13.1


Note You need to log in before you can comment on or make changes to this bug.