From: John Spray Date: Tue, 10 Feb 2015 12:37:20 +0000 (+0000) Subject: tasks/cephfs: fix fuse force unmount X-Git-Tag: v11.1.1~58^2^2~710^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=03b0e1064cc287c1cc42dae443d76a23f76d4921;p=ceph.git tasks/cephfs: fix fuse force unmount This was broken in the case of multiple mounts, and in the case of stuck mounts. Fixes: #10702 Signed-off-by: John Spray --- diff --git a/tasks/cephfs/fuse_mount.py b/tasks/cephfs/fuse_mount.py index ff42d2be79d9..8789c326239b 100644 --- a/tasks/cephfs/fuse_mount.py +++ b/tasks/cephfs/fuse_mount.py @@ -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',