From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8C4EC43331 for ; Thu, 26 Mar 2020 05:36:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83C5120772 for ; Thu, 26 Mar 2020 05:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726038AbgCZFgC (ORCPT ); Thu, 26 Mar 2020 01:36:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:50928 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbgCZFgC (ORCPT ); Thu, 26 Mar 2020 01:36:02 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 27E26AB98; Thu, 26 Mar 2020 05:36:01 +0000 (UTC) From: Qu Wenruo To: u-boot@lists.denx.de Cc: linux-btrfs@vger.kernel.org Subject: [PATCH U-BOOT v2 0/3] fs: btrfs: Fix false LZO decompression error due to missing page boundary check Date: Thu, 26 Mar 2020 13:35:53 +0800 Message-Id: <20200326053556.20492-1-wqu@suse.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org There is a bug that uboot can't load LZO compressed data extent while kernel can handle it without any problem. It turns out to be a page boundary case. The 3nd patch is the proper fix, cross-ported from btrfs-progs. The first patch is just to make my eyes less hurt. The second patch is to make sure the driver will reject sector size not matching PAGE_SIZE. This keeps the behavior the same as kernel, even in theory we could do better in U-boot. This is just a temporary fix, before better btrfs driver implemented. I guess it's time to backport proper code from btrfs-progs, other than using tons of immediate codes. Changelog: v2: - Fix code style problems - Add a new patch to reject non-page-sized sector size Since kernel does the same thing, and non-4K page size u-boot boards are really rare, it shouldn't be a big problem. Qu Wenruo (3): fs: btrfs: Use LZO_LEN to replace immediate number fs: btrfs: Reject fs with sector size other than PAGE_SIZE fs: btrfs: Fix LZO false decompression error caused by pending zero fs/btrfs/compression.c | 42 +++++++++++++++++++++++++++++++----------- fs/btrfs/super.c | 8 ++++++++ 2 files changed, 39 insertions(+), 11 deletions(-) -- 2.26.0