I've worked this out: we check if a disk is mounted (in order to unmount it) using the /dev/disk symlink, but it's the dereferenced device that appears in the mount table. If we dereference the symlink before checking the mount table, this goes away.
I've worked this out: we check if a disk is mounted (in order to unmount it) using the /dev/disk symlink, but it's the dereferenced device that appears in the mount table. If we dereference the symlink before checking the mount table, this goes away.
This is what the attached branch does.