From: Timofey Titovets <nefelim4ag@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Timofey Titovets <nefelim4ag@gmail.com>
Subject: [PATCH 3/3] Btrfs: zlib compression must free at least PAGE_SIZE
Date: Fri, 19 May 2017 16:38:35 +0300 [thread overview]
Message-ID: <20170519133835.27843-4-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/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
prev 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 ` [PATCH 2/3] Btrfs: lzo compression must free at least PAGE_SIZE Timofey Titovets
2017-05-19 14:17 ` 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 ` Timofey Titovets [this message]
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-4-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).