summaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-06-07 11:28:47 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-06-07 11:28:47 +0200
commitc246ad3432b90eabbf645b6207885307907d6339 (patch)
tree06e33cc0e3bd09868e83fec124c90a61b5c12603 /lib/sqfs/block_processor
parent5179a76bad4b760e76d1e3e18ca4c0a0a1edb6b4 (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>
Diffstat (limited to 'lib/sqfs/block_processor')
-rw-r--r--lib/sqfs/block_processor/backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqfs/block_processor/backend.c b/lib/sqfs/block_processor/backend.c
index acff7f5..b443c9d 100644
--- a/lib/sqfs/block_processor/backend.c
+++ b/lib/sqfs/block_processor/backend.c
@@ -202,7 +202,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;
@@ -213,7 +214,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));
}
if (proc->frag_tbl != NULL) {