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/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

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