summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-09 15:23:52 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-09 22:26:09 +0100
commit1ac10106665c16a6961e4a14ae15017003127932 (patch)
treebbbefde8f927335ac4fe2ce563624089c94ff8e1
parent72540bd9a673d47ecef622906cb0ee844e212732 (diff)
downloadlibguestfs-1ac10106665c16a6961e4a14ae15017003127932.tar.gz
libguestfs-1ac10106665c16a6961e4a14ae15017003127932.tar.xz
libguestfs-1ac10106665c16a6961e4a14ae15017003127932.zip
fuse: Document race condition possible with fusermount.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=835466#c9 (cherry picked from commit 1cde66165aac222f1a07ad4c3873c61d49eabb02)
-rw-r--r--fuse/guestmount.pod16
1 files changed, 16 insertions, 0 deletions
diff --git a/fuse/guestmount.pod b/fuse/guestmount.pod
index a0bc6f14..c37301c9 100644
--- a/fuse/guestmount.pod
+++ b/fuse/guestmount.pod
@@ -106,6 +106,22 @@ namespace using the Linux-specific L<clone(2)>/L<unshare(2)> flag
C<CLONE_NEWNS>. Unfortunately at the moment this requires root and we
would also probably need to add it as a feature to guestmount.
+=head2 Race conditions possible when shutting down the connection
+
+When C<fusermount -u> exits, guestmount may still be running and
+cleaning up the mountpoint. The disk image will not be fully
+finalized.
+
+This means that scripts like the following have a nasty race
+condition:
+
+ guestmount -a disk.img -i /mnt
+ # copy things into /mnt
+ fusermount -u /mnt
+ # immediately try to use 'disk.img' <-- UNSAFE
+
+The solution is to spin waiting for the guestmount process to exit.
+
=head1 OPTIONS
=over 4