From patchwork Fri May 19 13:38:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timofey Titovets X-Patchwork-Id: 9737293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D789B6034C for ; Fri, 19 May 2017 13:38:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B65AC28815 for ; Fri, 19 May 2017 13:38:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB00E28922; Fri, 19 May 2017 13:38:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5640D28815 for ; Fri, 19 May 2017 13:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755405AbdESNiv (ORCPT ); Fri, 19 May 2017 09:38:51 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33642 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbdESNiq (ORCPT ); Fri, 19 May 2017 09:38:46 -0400 Received: by mail-wm0-f66.google.com with SMTP id b84so2534608wmh.0 for ; Fri, 19 May 2017 06:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uu0/WgTCtHPd0M4g76ZI+SQSYDhIeOzZMOB/pxyEqG8=; b=JJt6ts868N36bYCky87nVADjf5YPTy/EepBbiAYk2NXR1MYjlCNuiU3fP9BXLkxEEg s70LtcBYIL/P9guhFEWTs+N8A60cgL8OqfJMALnEH/eBvr9gawisnkCpK+NPaCedcUuG nOo5hu4qNISA5FHW6KUIzSoTZcZyq5mmOpMT+Czg2r7iZoMPUbteAbjHWYrAa2nWjBHF HbjVyQ1Ae1RzDCY/Z+2RIFVSBYapNwNklXt6R4plz6g3UVibjGjfyDRJHQF7Z3GkbwWt YkhB5jrLqHb5nRH8WcoJWOhGhQgP+CDDLcJgDBsRRQsA6oljPDM41PqOyTcISDNbWW/2 pjZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uu0/WgTCtHPd0M4g76ZI+SQSYDhIeOzZMOB/pxyEqG8=; b=NCG6TXXfjsMQdTK7lw96ELmnz7G8pseNl4hJ+lAfIOOPOQvEEr3b7Xl6alXXgYpi44 /BsLziK923QxB9DURAiV30XF5KRJdTsdnDrsqBxElATbcZfsPxW2SYnWlGOvAAUdMhbC JEuD0x6n05lbchDj4cmKvh+DiKT4jmdd6Xn+EJJfty7nvdOWWyvjFinzonFF1DX/g8hc H3DTqaligvpVTsaI+RBYvjzO2n37GFkvejv3V7AVvtKv1z/mdgUgO0mcw4kIW8QydUPr n8hme/SxPKOL/HSImj2tzdsXcLYjCz/84cLblZXGjtDeya4WFq9SU4vnG2G3pH8eBJLM s1Dw== X-Gm-Message-State: AODbwcDmYeMBG6Nzn3+SXShb8nsxkLdp3kcRLsagyh9zEsfHezMmpbIx v/m8Ok6Iw6YwFA== X-Received: by 10.28.168.201 with SMTP id r192mr6750301wme.43.1495201125625; Fri, 19 May 2017 06:38:45 -0700 (PDT) Received: from titovetst-beplan.itransition.corp ([93.171.6.183]) by smtp.gmail.com with ESMTPSA id f78sm18957302wme.19.2017.05.19.06.38.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 06:38:45 -0700 (PDT) From: Timofey Titovets To: linux-btrfs@vger.kernel.org Cc: Timofey Titovets Subject: [PATCH 2/3] Btrfs: lzo compression must free at least PAGE_SIZE Date: Fri, 19 May 2017 16:38:34 +0300 Message-Id: <20170519133835.27843-3-nefelim4ag@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170519133835.27843-1-nefelim4ag@gmail.com> References: <20170519133835.27843-1-nefelim4ag@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If data compression didn't free at least one PAGE_SIZE, it useless to store that compressed extent Signed-off-by: Timofey Titovets --- 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; }