Commit 95db7ff5 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Change to last revision; make the test even more pessimistic to avoid

overrunning the compression subblock (chunk), which can happen if the
data is already compressed, and its right near the end of the block.
There is no recovery mechanism in place, and so muct be sure not to
end up with more compressed data than can fit.
parent 39ea2f89
......@@ -1490,8 +1490,8 @@ compress_chunk(off_t size, int *partial, unsigned long *subblksize)
* data won't be compressable (maybe its already compressed),
* and the output size will be *bigger* than the input size.
*/
if (count > subblockleft) {
count = subblockleft - (2 * secsize);
if (count > (subblockleft - 1024)) {
count = subblockleft - 1024;
/*
* But of course, we always want to be sector aligned.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment