From b853abd070a8d2014eca1296239b38dd384787b9 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 3 Feb 2017 10:59:43 +0100 Subject: [PATCH] nuke: improve stale_kernel_mount() check Commit 7db9e8b76fd5 ("nuke: bring stale kernel client handling back") resurrected the check that was removed in commit 1d47a121b385 ("Fix nuke, redo some cleanup functions"). It isn't sufficient though -- for example, if a workunit already issued a umount, /etc/mtab won't have a '^/dev/rbd' entry. debugfs is enabled and mounted on all distros we care about. Signed-off-by: Ilya Dryomov --- teuthology/nuke/actions.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/teuthology/nuke/actions.py b/teuthology/nuke/actions.py index de3ed28d1a..c3eee973bb 100644 --- a/teuthology/nuke/actions.py +++ b/teuthology/nuke/actions.py @@ -135,14 +135,16 @@ def remove_osd_tmpfs(ctx): def stale_kernel_mount(remote): proc = remote.run( args=[ - 'grep', '-q', ' ceph ', '/etc/mtab', - run.Raw('||'), - 'grep', '-q', '^/dev/rbd', '/etc/mtab', + 'sudo', 'find', + '/sys/kernel/debug/ceph', + '-mindepth', '1', + '-type', 'd', + run.Raw('|'), + 'read' ], check_status=False ) - # grep exists with 1 if no lines were selected - return proc.exitstatus != 1 + return proc.exitstatus == 0 def reboot(ctx, remotes): -- 2.39.5