Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2302703imj; Sun, 10 Feb 2019 23:58:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IazpOQD6mi9N+bnQplDyeykfal/F+LXCLtWx3FfxmLMdWvJvCBHJke83+yEdaJm1+YhKej1 X-Received: by 2002:a62:a510:: with SMTP id v16mr35351623pfm.18.1549871908882; Sun, 10 Feb 2019 23:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549871908; cv=none; d=google.com; s=arc-20160816; b=v4XRCMch4Av4ejyqVzFCavBMI0K/lqO0vQLOPIq5awTqCIFeyyk3Is/XPwhAxJqg2r zQdSWtLcdbVUZNtzJy+Ve2sPpsG1W2/+IoFVNR0b7fvMSfn2eGqU1zj6yCzQ+I6UXkix Dcqxy27v/Qeg+fg99QsPMZdMvr3QBSqAVZQX+XwiXr4ETImk944yPqdaeCA6jT8a7Fq/ 7j4SRt4NYCpFaZMx3CXlCip10Gl/YJWNBdbgGvpD/Y+7bxceNUGSKXE2Lad9MhInI1Mo DjNJ7MbquXdn9vxBNXlS3x/JDO+76bPB+kFkM6qHdp6hwtI3SKiRZFjuqE3bjfU9Rx+l Lytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id :references:cc:to:subject:from; bh=HA8cqieUTaGgJQlLgfYhcXAisYHtKSVMsJmJ/EBXMpM=; b=ZkQgPA9tKNB3N7/xPcYk4QiekwMSqHkr0dO8bfARxpzx4+eMd37uFXI8KOoLXUPXjz WayCun95LXSZqaf2SHc6W4jpa0AVtSqhWS72or0yIOZCH9kcxhT9vmMV4H7E5WK2f4Xu o1mUZMHiVoIxqSV+1nHHCKOJdZ7KQW87iIcpAdFTr2M2Nlfzqo8q0q1hZ2m7iVITP01w K5R54LCasLOqu4GLRnPFxjxn57UIkutIkLt7mY75zLH1bKYGF70EMRyUTbyxFTMTdlWI 4Rf5KIwG8ZJuAl8ZPCNyZ65xeLw3/iVm88cWVFzQ3P4WTt+xJJmTP/e21hWe3SutxkAy Ru8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i190si12021pfc.116.2019.02.10.23.58.12; Sun, 10 Feb 2019 23:58:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbfBKH4g (ORCPT + 99 others); Mon, 11 Feb 2019 02:56:36 -0500 Received: from mail.sysgo.com ([176.9.12.79]:57324 "EHLO mail.sysgo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbfBKH4f (ORCPT ); Mon, 11 Feb 2019 02:56:35 -0500 From: David Engraf Subject: Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs To: Andy Shevchenko , Andrew Morton Cc: Dominik Brodowski , Greg Kroah-Hartman , Philippe Ombredanne , Arnd Bergmann , Luc Van Oostenryck , Linux Kernel Mailing List References: <20181022134048.19693-1-david.engraf@sysgo.com> <20181030151805.5519-1-david.engraf@sysgo.com> <20190208140810.76ef6c25825a5644d9625f0a@linux-foundation.org> Message-ID: <744e7bcb-9315-0283-67c5-c2cb2d094251@sysgo.com> Date: Mon, 11 Feb 2019 08:56:32 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.02.19 at 11:35, Andy Shevchenko wrote: > On Sat, Feb 9, 2019 at 12:08 AM Andrew Morton wrote: >> On Fri, 8 Feb 2019 21:45:21 +0200 Andy Shevchenko wrote: >>> On Tue, Oct 30, 2018 at 5:22 PM David Engraf wrote: >>>> >>>> Unpacking an external initrd may fail e.g. not enough memory. This leads >>>> to an incomplete rootfs because some files might be extracted already. >>>> Fixed by cleaning the rootfs so the kernel is not using an incomplete >>>> rootfs. >>> >>> This breaks my setup where I have U-boot provided more size of >>> initramfs than needed. This allows a bit of flexibility to increase or >>> decrease initramfs compressed image without taking care of bootloader. >>> The proper solution is to do this if we sure that we didn't get enough >>> memory, otherwise I can't consider the error fatal to clean up rootfs. >> >> OK, thanks. Maybe David can suggest a fix - I'll queue up a revert >> meanwhile. >> >> I don't really understand the failure. Why does an oversized initramfs >> cause unpack_to_rootfs() to fail? > > In my case I have got "Junk in compressed archive". I don't know (I > would check if needed) which exact condition I got since there are > three places with this message. The file itself smaller than the size > passed through bootparam. So, when decomression is finished > (successfully!) we still have a garbarge in the memory which is not > related to archive. Message per se is okay to have, though I consider > this non-fatal. I can reproduce this special case. The unpacking decompresses the whole size instead of checking the archive size. I will have a look how to get the real archive size. Best regards - David