libfstools: Print error in case of loop blkdev failure
authorPetr Štetiar <ynezz@true.cz>
Tue, 26 Mar 2019 15:34:29 +0000 (16:34 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 28 Mar 2019 11:42:31 +0000 (12:42 +0100)
It took me quite some time today(while fixing squashfs+overlay on
armvirt) to find out, that I was missing support for loop block device
in kernel, so I'm adding error message which might be helpful for
someone else in the future as well.

Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
libfstools/rootdisk.c

index dd00c1b4e5b4aa9b748610fa3e93d301a67101a7..68a6296c401a64167d12059bf90e551fab10a6da 100644 (file)
@@ -258,8 +258,10 @@ static int rootdisk_volume_init(struct volume *v)
        char str[128];
        int ret = 0;
 
-       if (!p->loop_name[0] && rootdisk_create_loop(p) != 0)
+       if (!p->loop_name[0] && rootdisk_create_loop(p) != 0) {
+               ULOG_ERR("unable to create loop device\n");
                return -1;
+       }
 
        v->type = BLOCKDEV;
        v->blk = p->loop_name;