if (ret < 0)
break;
ret = btrfs_make_block_group(trans, fs_info, 0,
- BTRFS_BLOCK_GROUP_DATA,
- BTRFS_FIRST_CHUNK_TREE_OBJECTID,
- cur, len);
+ BTRFS_BLOCK_GROUP_DATA, cur, len);
if (ret < 0)
break;
cur += len;
goto fail;
fd = open(devname, O_RDWR);
if (fd < 0) {
- error("unable to open %s: %s", devname, strerror(errno));
+ error("unable to open %s: %m", devname);
goto fail;
}
btrfs_parse_features_to_string(features_buf, features);
}
}
btrfs_release_path(&path);
+ if (ret)
+ return ret;
/*
* For HOLES mode (without NO_HOLES), we must ensure file extents
* cover the whole range of the image
}
fd = open(devname, O_RDWR);
if (fd < 0) {
- error("unable to open %s: %s", devname, strerror(errno));
+ error("unable to open %s: %m", devname);
ret = -EIO;
goto free_mem;
}