Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp22737imj; Fri, 8 Feb 2019 14:10:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IY5Rumv0++eWqNMQE3EuEEHLk9snC9VbCqUMvCkEBI728LoHGtiMSDwmO50XnVzTG9MAa15 X-Received: by 2002:a63:f109:: with SMTP id f9mr17634886pgi.286.1549663814199; Fri, 08 Feb 2019 14:10:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549663814; cv=none; d=google.com; s=arc-20160816; b=wOPu2Rmc1lyjQH3b5P3s1x2Wu+eUtWbFICeJCiTxhbV0YsY5LvNa3MGRAcluV4HCZE FTZkmnXNBFM95bvWTcKSOnDbPEtn6g1bKy1r7IrDZkdn60TzYHrkYoPsS5aZmmDUz+kM RVu9BCtxBUA9u/U1xk6OI0TCXf3j+DeMHCAQLCLkwwurma67ROcwze9NZA4h8+2u66qG LQSPCieFygQASYAxghqiD7TwnZK4mhCwNfN3qOhIVCvMNvrmqrCWIk0xer5m6i9cC4kQ KLrxg4tUy9SnQrWsMp2ncJnOWGP/1gNTbsiXjOfTvIbcbWBs/JExp2FGZP65MCUUZa8B GEnQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=0Oef8A/+LbGsBgI4XETnrzFeupEwFtd1IM3C0Ii+LOw=; b=JuDvgMiNnES1BJY91ELH1yIRg4qsjAURdbeaBLEnXv+5arEJUycdn/S1iYAnByV6hp 3YQTOPDbniIM5NH0sTpq6NmRUI8jrpfsSrJxZ7Bipuu32Evy80BYPXRHJpAWzRX6HOSj 4kqH17PenvEwTuSKnVM8Ak7zgiuQ1kHzikPhmojfNxabXPOXflKVsj6mJQvmZhQTmWbH kbXUpR61UOq7T5lnsVoRQ1rax/Kf5MSOU4abnp9SxP5ILdaQM81Vc6OzLa3Y6qHBcnpx ZfOa3Y4UUOuVuvp1c11irODjh7Osww5OITskirKAyr1hRWNp+ns+xzErsVKhxlxTEqv6 iv6A== 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 n10si3328932pgd.57.2019.02.08.14.09.57; Fri, 08 Feb 2019 14:10:14 -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 S1726994AbfBHWIN (ORCPT + 99 others); Fri, 8 Feb 2019 17:08:13 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33590 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfBHWIM (ORCPT ); Fri, 8 Feb 2019 17:08:12 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 83C5AC9BA; Fri, 8 Feb 2019 22:08:11 +0000 (UTC) Date: Fri, 8 Feb 2019 14:08:10 -0800 From: Andrew Morton To: Andy Shevchenko Cc: David Engraf , Dominik Brodowski , Greg Kroah-Hartman , Philippe Ombredanne , Arnd Bergmann , Luc Van Oostenryck , Linux Kernel Mailing List Subject: Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs Message-Id: <20190208140810.76ef6c25825a5644d9625f0a@linux-foundation.org> In-Reply-To: References: <20181022134048.19693-1-david.engraf@sysgo.com> <20181030151805.5519-1-david.engraf@sysgo.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?