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 <idryomov@gmail.com>
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):