diff mbox

[3/3] Btrfs: zlib compression must free at least PAGE_SIZE

Message ID 20170519133835.27843-4-nefelim4ag@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Timofey Titovets May 19, 2017, 1:38 p.m. UTC
If data compression didn't free at least one PAGE_SIZE, it useless to store that compressed extent

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

Patch

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;
 		}