try_loopdev:
fs = mnt_table_find_target(mtab, tgt, MNT_ITER_BACKWARD);
if (!fs && mnt_context_is_swapmatch(cxt)) {
- /* maybe the option is source rather than target (mountpoint) */
+ /*
+ * Maybe the option is source rather than target (sometimes
+ * people use e.g. "umount /dev/sda1")
+ */
fs = mnt_table_find_source(mtab, tgt, MNT_ITER_BACKWARD);
if (fs) {
}
}
- if (!fs && !loopdev) {
+ if (!fs && !loopdev && mnt_context_is_swapmatch(cxt)) {
/*
- * Maybe target is /path/file.img, try to convert to /dev/loopN
+ * Maybe the option is /path/file.img, try to convert to /dev/loopN
*/
struct stat st;