Subject: [PATCH] ext2: propagate volume-open errors when probing the superblock open_volume() returns a negative errno on failure. Negating rc, which is still zero, makes fsim_get_ext2_superblock() report success without reading or validating the superblock. fs_probe() then accepts the volume as Ext4. Return the positive error code from fd, as expected by the FSIM interface. diff --git a/plugins/ext2/fsimext2.c b/plugins/ext2/fsimext2.c index a30448c..d18fd66 100644 --- a/plugins/ext2/fsimext2.c +++ b/plugins/ext2/fsimext2.c @@ -523,7 +523,7 @@ int fsim_get_ext2_superblock( logical_volume_t *volume, struct ext2_super_block fd = EngFncs->open_volume(volume, O_RDONLY, 0); if (fd < 0) { - rc = -rc; + rc = -fd; LOG_EXIT_INT(rc); return rc; }