diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 45bed868cb..b84ef46442 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -1907,11 +1907,6 @@ static int mount_partition( if (!fstype) return -EAFNOSUPPORT; - r = dissect_fstype_ok(fstype); - if (r < 0) - return r; - if (!r) - return -EIDRM; /* Recognizable error */ /* We are looking at an encrypted partition? This either means stacked encryption, or the caller * didn't call dissected_image_decrypt() beforehand. Let's return a recognizable error for this @@ -1919,6 +1914,12 @@ static int mount_partition( if (streq(fstype, "crypto_LUKS")) return -EUNATCH; + r = dissect_fstype_ok(fstype); + if (r < 0) + return r; + if (!r) + return -EIDRM; /* Recognizable error */ + rw = m->rw && !(flags & DISSECT_IMAGE_MOUNT_READ_ONLY); discard = ((flags & DISSECT_IMAGE_DISCARD) ||