]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: fix fuse force unmount
authorJohn Spray <jspray@redhat.com>
Tue, 10 Feb 2015 12:37:20 +0000 (12:37 +0000)
committerJohn Spray <jspray@redhat.com>
Tue, 10 Feb 2015 14:58:23 +0000 (14:58 +0000)
This was broken in the case of multiple
mounts, and in the case of stuck mounts.

Fixes: #10702
Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/fuse_mount.py

index ff42d2be79d965fdf69aa6ba2c7d039ace482068..8789c326239b86d91a616ddaa2d73ba48abc6fe0 100644 (file)
@@ -97,6 +97,7 @@ class FuseMount(CephFSMount):
         else:
             log.debug('ceph-fuse not mounted, got fs type {fstype!r}'.format(
                 fstype=fstype))
+            return False
 
     def wait_until_mounted(self):
         """
@@ -132,20 +133,16 @@ class FuseMount(CephFSMount):
             )
         except run.CommandFailedError:
             log.info('Failed to unmount ceph-fuse on {name}, aborting...'.format(name=self.client_remote.name))
+
             # abort the fuse mount, killing all hung processes
             self.client_remote.run(
                 args=[
-                    'if', 'test', '-e', '/sys/fs/fuse/connections/*/abort',
-                    run.Raw(';'), 'then',
-                    'echo',
-                    '1',
-                    run.Raw('>'),
-                    run.Raw('/sys/fs/fuse/connections/*/abort'),
-                    run.Raw(';'), 'fi',
-                ],
+                    "find", "/sys/fs/fuse/connections", "-name", "abort",
+                    "-exec", "bash", "-c", "echo 1 > {}", "\;"
+                ]
             )
             # make sure its unmounted
-            if self._mountpoint_exists():
+            if self.is_mounted():
                 self.client_remote.run(
                     args=[
                         'sudo',