mkfs: move 'mounted' check before 'existing fs' check
Check if a device is mounted (and issue an error about that) before
asking for -f flag.
Example of the old behaviour I'm changing:
$ mkfs.xfs /dev/sda1
mkfs.xfs: /dev/sda1 appears to contain an existing filesystem (xfs).
mkfs.xfs: Use the -f option to force overwrite.
$ mkfs.xfs -f /dev/sda1
mkfs.xfs: /dev/sda1 contains a mounted filesystem
Signed-off-by: Jan Tulak <jtulak@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>