If data compression didn't free at least one PAGE_SIZE, it useless to store 
that compressed extent

Signed-off-by: Timofey Titovets <nefelim...@gmail.com>
---
 fs/btrfs/zlib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
index 135b1082..7c3c27e6 100644
--- a/fs/btrfs/zlib.c
+++ b/fs/btrfs/zlib.c
@@ -134,7 +134,7 @@ static int zlib_compress_pages(struct list_head *ws,
                /* we're making it bigger, give up */
                if (workspace->strm.total_in > 8192 &&
                    workspace->strm.total_in <
-                   workspace->strm.total_out) {
+                   workspace->strm.total_out + PAGE_SIZE) {
                        ret = -E2BIG;
                        goto out;
                }
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to