From patchwork Sat Oct 5 14:17:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Tokarev X-Patchwork-Id: 280770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9063A2C00CD for ; Sun, 6 Oct 2013 00:18:14 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VSSgB-0008Pd-0R; Sat, 05 Oct 2013 14:17:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VSSg9-0001o7-Cq; Sat, 05 Oct 2013 14:17:57 +0000 Received: from forward1h.mail.yandex.net ([2a02:6b8:0:f05::10]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VSSg6-0001nm-8x for linux-mtd@lists.infradead.org; Sat, 05 Oct 2013 14:17:55 +0000 Received: from web23h.yandex.ru (web23h.yandex.ru [84.201.187.157]) by forward1h.mail.yandex.net (Yandex) with ESMTP id 1175A9E24D7; Sat, 5 Oct 2013 18:17:31 +0400 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web23h.yandex.ru (Yandex) with ESMTP id 5E035184155D; Sat, 5 Oct 2013 18:17:31 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1380982651; bh=knDKv9s+0MUMYE6HKvvmzWfZ+qN3U48EA+VTmmrc2nY=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=Lxc6wAtX+mQA/0E6e0AXwHTvD+K2zrsDARoR0um9QwSbsJUEB8T8WzNgV0m/VLDr8 x006gbwiJ6x5zdojP7n3/ctRZ8PEZGo42ZyN0/Wb2NSxt6+1ah7Lak1iM3W/5OmU3F 74TEmwcfpfN/hkW9+7jDdHFraVGO9yRoN3B5lqYo= Received: from ppp37-190-59-26.pppoe.spdop.ru (ppp37-190-59-26.pppoe.spdop.ru [37.190.59.26]) by web23h.yandex.ru with HTTP; Sat, 05 Oct 2013 18:17:31 +0400 From: Konstantin Tokarev To: Elie De Brauwer In-Reply-To: <201501380981068@web15m.yandex.ru> References: <1380956001-6122-1-git-send-email-eliedebrauwer@gmail.com> <106341380974003@web15m.yandex.ru> <183051380979480@web15m.yandex.ru> <201501380981068@web15m.yandex.ru> Subject: Re: [PATCH v0] mkfs.ubifs: Add support for lz4hc compressor in mkfs.ubifs MIME-Version: 1.0 Message-Id: <8451380982651@web23h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 05 Oct 2013 18:17:31 +0400 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131005_101754_654593_6B6C6E66 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 2.4 FSL_HELO_BARE_IP_2 FSL_HELO_BARE_IP_2 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (annulen[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: "linux-mtd@lists.infradead.org" , "motobud@gmail.com" , "dedekind1@gmail.com" X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 05.10.2013, 17:52, "Konstantin Tokarev" : > 05.10.2013, 17:25, "Konstantin Tokarev" : > >>  05.10.2013, 16:56, "Elie De Brauwer" : >>>   That's odd, yesterday I started by cloning mtd-utils.git and when I >>>   try to repeat my own steps and apply my patch it does seem to work. >>  I've figured it out: you've included patch into the mail instead of attaching >>  it as a file, so I copied it, and tab characters got lost. patch -p1 -l >>  works successfully. > > When trying to compress my rootfs, I got message "32866 compression errors occurred". > Resulting image is much larger than LZO one (133M for lz4hc, 86M for lzo, 79M for zlib) The next patch over your patch fixes the issue: I've replaced LZ4_compressHC_limitedOutput with LZ4_compressHC to match lzo_compress logic which changes out_len instead of limiting it. No errors are reported now. However, result is still larger than LZO (93M). diff --git a/mkfs.ubifs/compr.c b/mkfs.ubifs/compr.c index 2030042..65c7dbe 100644 --- a/mkfs.ubifs/compr.c +++ b/mkfs.ubifs/compr.c @@ -109,9 +109,10 @@ static int lz4hc_compress(void *in_buf, size_t in_len, void *out_buf, size_t *out_len) { int ret; - ret = LZ4_compressHC_limitedOutput(in_buf, out_buf, in_len, *out_len); + ret = LZ4_compressHC(in_buf, out_buf, in_len); + *out_len = ret; - if (ret != 0) { + if (ret == 0) { errcnt += 1; return -1; }