<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib/sqfs/block_processor, branch fixes-1.2.0</title>
<subtitle>A new set of tools and libraries for working with SquashFS images</subtitle>
<id>https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.2.0</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.2.0'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2022-11-18T15:21:12+00:00</updated>
<entry>
<title>libsqfs: Fix an overzealous bounds check in the block processor</title>
<updated>2022-11-18T15:21:12+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-11-18T15:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=9d189b6091a7011bfac8a9c09af750614d82a10d'/>
<id>urn:sha1:9d189b6091a7011bfac8a9c09af750614d82a10d</id>
<content type='text'>
When (during fragment deduplication) a fragment block is read back
from disk and unpacked, it can happen that it is _exactly_ the
given block size. The bounds check did '&gt;=' instead of '&gt;' and
failed in that case with a "data corruption" error.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move libutil headers to sub directory</title>
<updated>2022-07-08T17:17:35+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-06-26T14:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=2087cc237cd0fe1ed29ebf891648bacb46f4833b'/>
<id>urn:sha1:2087cc237cd0fe1ed29ebf891648bacb46f4833b</id>
<content type='text'>
Move all the libutil stuff from the toplevel include/ to a util/
sub directory and fix up the includes that make use of them.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libsquashfs: fix: also preserve alignment flag in block processor</title>
<updated>2021-06-07T09:28:47+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-06-07T09:28:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=c246ad3432b90eabbf645b6207885307907d6339'/>
<id>urn:sha1:c246ad3432b90eabbf645b6207885307907d6339</id>
<content type='text'>
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 &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libsqfs: block processor: Fix account for manually submitted blocks</title>
<updated>2021-03-30T10:42:43+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-30T10:40:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=d92098b92dad44eeb4bf40bfca8818bd2d660a99'/>
<id>urn:sha1:d92098b92dad44eeb4bf40bfca8818bd2d660a99</id>
<content type='text'>
This was already in the original block processor but got dropped by
accident when restructuring it.

The problem manifests itself when manually submitting fragment blocks.
They no longer get correct I/O queue tickets, clog up the queue and
the processor eventually throws an internal error.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix fail branch in block processor fragment backend</title>
<updated>2021-03-25T13:47:06+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-25T13:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=62a3a2e1ab14ca97a91376a6cc99be63c05db480'/>
<id>urn:sha1:62a3a2e1ab14ca97a91376a6cc99be63c05db480</id>
<content type='text'>
Only clean up the fragment if it hasn't been re-assigned to the
fragment block. The NULL check is definitely wrong, because we
no longer re-assign it as NULL.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix block processor queue accounting</title>
<updated>2021-03-24T13:05:18+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-24T12:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=14d0d4d55ed579c471ec24c03cb3808d4d721a79'/>
<id>urn:sha1:14d0d4d55ed579c471ec24c03cb3808d4d721a79</id>
<content type='text'>
Dequeuing won't work if we have a backlog of 1 or 2 and the blocks
are used for internal buffering. Take that into account, similar to
the sync code. Also bump the minimum backlog to 3, just to make
absolutely sure we cannot run into a dequeue loop trying to allocate
a block.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>block processor: Re-implement exact fragment matching</title>
<updated>2021-03-23T10:39:52+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-23T10:32:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=947670d992454033a13c70e36a53a2ac10b3d6ad'/>
<id>urn:sha1:947670d992454033a13c70e36a53a2ac10b3d6ad</id>
<content type='text'>
In the hash-table equals callback, if the hash and size match, do an
exact, byte-for-byte comparison of the fragment in question. The
fragment can either be in a fragment block that is in-flight (for which
we have the in-flight list), in the current, unfinished fragment block,
or it can be on disk.

In the later case, the fragment block is resolved through the fragment
table and read back from disk into a scratch buffer and decompressed.
After that, the fragment is checked for byte-for-byte equality with
the one we resolved through the hash table.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>block processor: keep duplicate copies of in-flight fragment blocks</title>
<updated>2021-03-23T10:00:49+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-22T10:55:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=cb8b925130c0ff5cdb445ad36fde47ca4f58e645'/>
<id>urn:sha1:cb8b925130c0ff5cdb445ad36fde47ca4f58e645</id>
<content type='text'>
If we want full, byte-for byte, verification of fragments during
de-duplication we need to check back with the blocks already written
to disk, or with the ones that are in flight.

The previous, extremely hacky approach simply locked up the thread
pool and investigated the queues. For the new approach, we treat the
thread pool as completely opaque and don't try to touch it.

This commit modifies the block processor to keep duplicate copies of
each submitted fragment block around, that are cleaned up once the
block is dequeued and written to disk. So instead of touching the
thread pool, we can simply investigate the in-fligth-block list and
the current block, before resorting to reading back fragment blocks
from the file.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>block processor: simplify backlog accounting</title>
<updated>2021-03-22T20:09:54+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-22T15:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e8cc53ad5fbac2cb2f578091125dc506f136bfde'/>
<id>urn:sha1:e8cc53ad5fbac2cb2f578091125dc506f136bfde</id>
<content type='text'>
Simply count the number of blocks we hand out (malloc'ed or recycled)
and decrease the counter when we put blocks back for recycling.

The sync() part becomes a little more complicated, because we can get
stuck with a backlog of 1 or 2 because we have a fragment or current
block buffer in use. We also need to accout for this when creating the
processor, because we need to be able to request at least 2 blocks
without stalling.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup the block processor file structure</title>
<updated>2021-03-22T14:26:47+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-22T10:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=5aa0f30173ecf3b6538b9136cb4783fc19266288'/>
<id>urn:sha1:5aa0f30173ecf3b6538b9136cb4783fc19266288</id>
<content type='text'>
A cleaner separation between common code, frontend code and backend
code is made.

The "is this byte blob zero" function is moved out to libutil (with
test case and everything) with a more optimized implementation.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
