[glib/wjt/g-file-info-filesystem-readonly-fails: 2/5] tests/g-file-info-filesystem-readonly: unmount lazily



commit 5b106cdc56f4acda353d2cd025224dc52c9ba443
Author: Will Thompson <will willthompson co uk>
Date:   Mon Nov 12 14:46:34 2018 +0000

    tests/g-file-info-filesystem-readonly: unmount lazily
    
    fusermount -z behaves like umount --lazy, which is documented thus:
    
    > Detach the filesystem from the file hierarchy now, and clean up all
    > references to this filesystem as soon as it is not busy anymore.
    
    Without this, the call to `fusermount -u` often fails with:
    
      /usr/bin/fusermount: failed to unmount /home/wjt/src/gnome/glib/_build/dir_bindfs_mountpoint: Device or 
resource busy
    
    which causes the subsequent call to bindfs to fail:
    
      fuse: mountpoint is not empty
      fuse: if you are sure this is safe, use the 'nonempty' mount option
    
    It's not clear what is causing the mount to be busy. Inserting a
    g_usleep (100 * 1000) before the calls to `fusermount -u` also works to
    make the problem go away, but for the purposes of this test the
    important point is that the mount is detached from the directory, for
    which a lazy unmount is fine.
    
    Fixes #1590.

 gio/tests/g-file-info-filesystem-readonly.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/g-file-info-filesystem-readonly.c b/gio/tests/g-file-info-filesystem-readonly.c
index ff16fbbe0..a1a2ca546 100644
--- a/gio/tests/g-file-info-filesystem-readonly.c
+++ b/gio/tests/g-file-info-filesystem-readonly.c
@@ -130,7 +130,7 @@ test_filesystem_readonly (gconstpointer with_mount_monitor)
     }
 
   /* Now we unmount, and mount again but this time rw (not readonly) */
-  run (&error, fusermount, "-u", dir_mountpoint, NULL);
+  run (&error, fusermount, "-z", "-u", dir_mountpoint, NULL);
   g_assert_no_error (error);
   run (&error, bindfs, "-n", dir_to_mount, dir_mountpoint, NULL);
   g_assert_no_error (error);
@@ -169,7 +169,7 @@ test_filesystem_readonly (gconstpointer with_mount_monitor)
   g_clear_object (&mount_monitor);
   g_clear_object (&file_info);
   g_clear_object (&mounted_file);
-  run (&error, fusermount, "-u", dir_mountpoint, NULL);
+  run (&error, fusermount, "-z", "-u", dir_mountpoint, NULL);
   g_assert_no_error (error);
 
   assert_remove (file_in_mount);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]