libfstools: Fix overflow of F2FS_MINSIZE constant
[project/fstools.git] / libfstools / rootdisk.c
index dd00c1b4e5b4aa9b748610fa3e93d301a67101a7..5a6dcb9fc9aa66987630d0ff53e6796c3fda263b 100644 (file)
@@ -11,7 +11,6 @@
  * GNU General Public License for more details.
  */
 
-#define F2FS_MINSIZE   (100 * 1024 * 1024)
 #define _FILE_OFFSET_BITS 64
 
 #include <sys/types.h>
@@ -31,6 +30,7 @@
 #include <linux/loop.h>
 
 #define ROOTDEV_OVERLAY_ALIGN  (64ULL * 1024ULL)
+#define F2FS_MINSIZE           (100ULL * 1024ULL * 1024ULL)
 
 struct squashfs_super_block {
        uint32_t s_magic;
@@ -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;