aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/block_processor/backend.c')
-rw-r--r--lib/sqfs/block_processor/backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/sqfs/block_processor/backend.c b/lib/sqfs/block_processor/backend.c
index 68e299e..d71c632 100644
--- a/lib/sqfs/block_processor/backend.c
+++ b/lib/sqfs/block_processor/backend.c
@@ -58,6 +58,24 @@ static int process_completed_block(sqfs_block_processor_t *proc, sqfs_block_t *b
sqfs_u32 size;
int err;
+ if (blk->flags & SQFS_BLK_FRAGMENT_BLOCK) {
+ sqfs_block_t *it = proc->fblk_in_flight, *prev = NULL;
+
+ while (it != NULL && it->index != blk->index) {
+ prev = it;
+ it = it->next;
+ }
+
+ if (it != NULL) {
+ if (prev == NULL) {
+ proc->fblk_in_flight = it->next;
+ } else {
+ prev->next = it->next;
+ }
+ free(it);
+ }
+ }
+
err = proc->wr->write_data_block(proc->wr, blk->user, blk->size,
blk->checksum,
blk->flags & ~BLK_FLAG_INTERNAL,