linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Timofey Titovets <nefelim4ag@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Timofey Titovets <nefelim4ag@gmail.com>
Subject: [PATCH 2/3] Btrfs: lzo compression must free at least PAGE_SIZE
Date: Fri, 19 May 2017 16:38:34 +0300	[thread overview]
Message-ID: <20170519133835.27843-3-nefelim4ag@gmail.com> (raw)
In-Reply-To: <20170519133835.27843-1-nefelim4ag@gmail.com>

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/lzo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index bd0b0938..637ef1b0 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -207,7 +207,7 @@ 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 + PAGE_SIZE) {
 			ret = -E2BIG;
 			goto out;
 		}
-- 
2.13.0


  parent reply	other threads:[~2017-05-19 13:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 13:38 [PATCH 0/3] Btrfs: compression fixes Timofey Titovets
2017-05-19 13:38 ` [PATCH 1/3] Btrfs: lzo.c pr_debug() deflate->lzo Timofey Titovets
2017-05-19 13:38 ` Timofey Titovets [this message]
2017-05-19 14:17   ` [PATCH 2/3] Btrfs: lzo compression must free at least PAGE_SIZE Lionel Bouton
2017-05-19 20:19     ` Lionel Bouton
2017-05-19 21:15       ` Timofey Titovets
2017-05-20 15:47         ` Lionel Bouton
2017-05-20 16:23           ` Timofey Titovets
2017-05-19 13:38 ` [PATCH 3/3] Btrfs: zlib " Timofey Titovets

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170519133835.27843-3-nefelim4ag@gmail.com \
    --to=nefelim4ag@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).