Set license using %license
[platform/upstream/btrfs-progs.git] / mkfs / main.c
index b65b18d..9bfddf3 100644 (file)
@@ -1099,7 +1099,7 @@ int main(int argc, char **argv)
        }
 
        fs_info = open_ctree_fs_info(file, 0, 0, 0,
-                       OPEN_CTREE_WRITES | OPEN_CTREE_FS_PARTIAL);
+                       OPEN_CTREE_WRITES | OPEN_CTREE_TEMPORARY_SUPER);
        if (!fs_info) {
                error("open ctree failed");
                goto error;
@@ -1295,6 +1295,12 @@ out:
                }
        }
 
+       if (!ret && close_ret) {
+               ret = close_ret;
+               error("failed to close ctree, the filesystem may be inconsistent: %d",
+                     ret);
+       }
+
        btrfs_close_all_devices();
        free(label);