summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-02-06 18:24:52 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-02-06 18:24:52 +0000
commita98170e0e255021481cd428ee12d0858a59a875b (patch)
treec49d5a5ff986d80bad1da48f5a8b640eca79a3d3
parent3c9ef0e9780443d28a078c49bab80cb13e5608ae (diff)
downloadlibguestfs-a98170e0e255021481cd428ee12d0858a59a875b.tar.gz
libguestfs-a98170e0e255021481cd428ee12d0858a59a875b.tar.xz
libguestfs-a98170e0e255021481cd428ee12d0858a59a875b.zip
Revert "daemon: Run udev_settle after pwrite-device finishes."
This reverts commit a9c8123c72db47bcab8dd738e8d5256a9ae87f11.
-rw-r--r--daemon/file.c18
-rw-r--r--daemon/parted.c3
2 files changed, 4 insertions, 17 deletions
diff --git a/daemon/file.c b/daemon/file.c
index 057e15d1..91746e0d 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -525,7 +525,7 @@ do_pread_device (const char *device, int count, int64_t offset, size_t *size_r)
static int
pwrite_fd (int fd, const char *content, size_t size, int64_t offset,
- const char *display_path, int settle)
+ const char *display_path)
{
ssize_t r;
@@ -541,18 +541,6 @@ pwrite_fd (int fd, const char *content, size_t size, int64_t offset,
return -1;
}
- /* When you call close on any block device, udev kicks off a rule
- * which runs blkid to reexamine the device. We need to wait for
- * this rule to finish running since it holds the device open and
- * can cause other operations to fail, notably BLKRRPART. 'settle'
- * flag is only set on block devices.
- *
- * XXX We should be smarter about when we do this or should get rid
- * of the udev rules since we don't use blkid in cached mode.
- */
- if (settle)
- udev_settle ();
-
return r;
}
@@ -575,7 +563,7 @@ do_pwrite (const char *path, const char *content, size_t size, int64_t offset)
return -1;
}
- return pwrite_fd (fd, content, size, offset, path, 0);
+ return pwrite_fd (fd, content, size, offset, path);
}
int
@@ -593,7 +581,7 @@ do_pwrite_device (const char *device, const char *content, size_t size,
return -1;
}
- return pwrite_fd (fd, content, size, offset, device, 1);
+ return pwrite_fd (fd, content, size, offset, device);
}
/* This runs the 'file' command. */
diff --git a/daemon/parted.c b/daemon/parted.c
index 64a7d1d9..16f0843c 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -34,8 +34,7 @@
* COMMAND_FLAG_FOLD_STDOUT_ON_STDERR flag.
*
* parted occasionally fails to do ioctl(BLKRRPART) on the device,
- * probably because udev monitors all 'close' on block devices
- * and runs 'blkid' which opens and examines the device. We attempt
+ * apparently because of some internal race in the code. We attempt
* to detect and recover from this error if we can.
*/
static int