From patchwork Fri May 19 13:38:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timofey Titovets X-Patchwork-Id: 9737295 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 26A566034C for ; Fri, 19 May 2017 13:38:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0535D288FA for ; Fri, 19 May 2017 13:38:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE1CE28928; Fri, 19 May 2017 13:38:55 +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 94D1E28922 for ; Fri, 19 May 2017 13:38:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755297AbdESNix (ORCPT ); Fri, 19 May 2017 09:38:53 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33681 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753377AbdESNir (ORCPT ); Fri, 19 May 2017 09:38:47 -0400 Received: by mail-wm0-f68.google.com with SMTP id b84so2534647wmh.0 for ; Fri, 19 May 2017 06:38:47 -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=qyrOxTtx/PTGf038O7sDSjZ2DwuHkMCeANnz22ptlf8=; b=SEzsoZOzYJMrrcojtjJ5PZ+9uJEbLZLcq7k6sXuYdfzxy2DfTJcs4RgJHtRYUnA/Tq g1TqNvWWuOYr/gbaXwQXNBRZL0iYQ502yFy2CXdeDZAt5FL8SzXQVuoiIPXQ5MnHw8ne KzxlOCCZDvGgJpJRtSFcHo0l5bom2PUg3rENKWl12HsetSqdPSM2gGj76sNaVotqsCj0 /ut56XvTjMCbwOqkEv2FsGPRWzJ6yS41YuELeQ+t8WNfT0y/QF3F/wfi/faS4A69aqc4 pGDEzCDM7zRguy0Z02q+RuqkFQPKUdtYxV28FR997/4g0o7Qna1d8b+IeFiOm39/PLHJ ICVQ== 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=qyrOxTtx/PTGf038O7sDSjZ2DwuHkMCeANnz22ptlf8=; b=V/CQdCKmzvwvzT/gm1VCwE3wayv8qhHgpdqPj2NqentVsOhvDNEBRE7PwvlLEEODu5 x9fTyKgyr0loRc9sBz7BrzY0+zFvinym4C4NhFGQ/ZqLFzgSEKmFMdygdHgz/AVbLf4L XUZKK3Dmjl7AjegkGLRY/USscb2EF4eZcqucc+FTe5Fg7bfTwrLME4Iz3uYc2OTY9enj joUV9DmihyqoV574cIk1pqyJei2AW5Em2gEI+djdTxIs5kiOIlzxojmGqZdwfd7p3rSS f+TCssjFgQDUgrEP8jHB/UHoqreMtiDFHYHHr7VuFer8MyqPJls2UhwSOVdwkbvoSjj/ JuYg== X-Gm-Message-State: AODbwcDBygDpwfORkFlRQBKGWf2sEpTZn75TmiDMS6syY3v+PuA+toFO XIP7ntz6b+WwEbXR X-Received: by 10.28.57.6 with SMTP id g6mr18543265wma.63.1495201126322; Fri, 19 May 2017 06:38:46 -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.45 (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 3/3] Btrfs: zlib compression must free at least PAGE_SIZE Date: Fri, 19 May 2017 16:38:35 +0300 Message-Id: <20170519133835.27843-4-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/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; }