}
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;
}
}
+ 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);