提交 59516f60 编写于 作者: S Stefan Agner 提交者: Chris Mason

Btrfs: return -1 when lzo compression makes data bigger

With this fix the lzo code behaves like the zlib code by returning an
error
code when compression does not help reduce the size of the file.
This is currently not a bug since the compressed size is checked again
in
the calling method compress_file_range.
Signed-off-by: NStefan Agner <stefan@agner.ch>
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
Signed-off-by: NChris Mason <chris.mason@fusionio.com>
上级 c8cc6341
......@@ -207,8 +207,10 @@ static int lzo_compress_pages(struct list_head *ws,
}
/* we're making it bigger, give up */
if (tot_in > 8192 && tot_in < tot_out)
if (tot_in > 8192 && tot_in < tot_out) {
ret = -1;
goto out;
}
/* we're all done */
if (tot_in >= len)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册