Call ntfs_attr_truncate_solid() with the size of each stream before extracting
it as a NTFS attribute. This should allocate the space (extents, etc.) needed
for the data before actually extracting it.
while (1) {
struct lookup_table_entry *lte;
while (1) {
struct lookup_table_entry *lte;
lte = inode_stream_lte_resolved(inode, stream_idx);
lte = inode_stream_lte_resolved(inode, stream_idx);
* Otherwise, we must open the attribute and extract the data.
* */
if (lte) {
* Otherwise, we must open the attribute and extract the data.
* */
if (lte) {
na = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_len);
if (!na) {
ERROR_WITH_ERRNO("Failed to open a data stream of "
na = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_len);
if (!na) {
ERROR_WITH_ERRNO("Failed to open a data stream of "
ret = WIMLIB_ERR_NTFS_3G;
break;
}
ret = WIMLIB_ERR_NTFS_3G;
break;
}
+ ret = ntfs_attr_truncate_solid(na, wim_resource_size(lte));
+ if (ret != 0) {
+ ntfs_attr_close(na);
+ break;
+ }
+
ret = extract_wim_resource_to_ntfs_attr(lte, na);
ret = extract_wim_resource_to_ntfs_attr(lte, na);
if (ret != 0)
break;
args->progress.extract.completed_bytes += wim_resource_size(lte);
if (ret != 0)
break;
args->progress.extract.completed_bytes += wim_resource_size(lte);
}
if (stream_idx == inode->num_ads)
break;
}
if (stream_idx == inode->num_ads)
break;