aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-06-07 14:32:23 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-06-07 14:32:23 +0200
commita49a5bc6253883f8dab06d5bae7e5453008da164 (patch)
tree0307da551b0e54ee81ed5e4619e56c83165eb167
parent85d88bcdc74d6a092a2932ff6b80ac455556f0ce (diff)
libsquashfs: fix: also preserve alignment flag in block processor
Currently, when the block processor aggreagtes fragments into a fragment block, it applies the "don't compress" flag if any of the original framgnets has it set, but the "align to device block" flag is lost. This commit ensures that both flags get applied to the fragment block if set. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/sqfs/block_processor/common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqfs/block_processor/common.c b/lib/sqfs/block_processor/common.c
index d6c0889..7d31954 100644
--- a/lib/sqfs/block_processor/common.c
+++ b/lib/sqfs/block_processor/common.c
@@ -215,7 +215,8 @@ static int process_completed_fragment(sqfs_block_processor_t *proc,
offset = 0;
proc->frag_block = frag;
proc->frag_block->index = index;
- proc->frag_block->flags &= SQFS_BLK_DONT_COMPRESS;
+ proc->frag_block->flags &=
+ (SQFS_BLK_DONT_COMPRESS | SQFS_BLK_ALIGN);
proc->frag_block->flags |= SQFS_BLK_FRAGMENT_BLOCK;
} else {
index = proc->frag_block->index;
@@ -226,7 +227,8 @@ static int process_completed_fragment(sqfs_block_processor_t *proc,
proc->frag_block->size += frag->size;
proc->frag_block->flags |=
- (frag->flags & SQFS_BLK_DONT_COMPRESS);
+ (frag->flags &
+ (SQFS_BLK_DONT_COMPRESS | SQFS_BLK_ALIGN));
release_old_block(proc, frag);
}