Logic already skips if compression makes data bigger, let's sync lzo
with zlib and also return error if compressed size is equal to
input size.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
                in_len = min(bytes_left, PAGE_SIZE);
        }
 
-       if (tot_out > tot_in)
+       if (tot_out >= tot_in) {
+               ret = -E2BIG;
                goto out;
+       }
 
        /* store the size of all chunks of compressed data */
        cpage_out = kmap(pages[0]);