Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3850905imj; Tue, 12 Feb 2019 05:50:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IbjPkFLVv+RuaJiBgKC+K5Cs9OpInsAx4YmjKVT9akowItBGV1UjAaC3hV20dggeZwuvzju X-Received: by 2002:a63:fa58:: with SMTP id g24mr3701724pgk.390.1549979452272; Tue, 12 Feb 2019 05:50:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549979452; cv=none; d=google.com; s=arc-20160816; b=osEI38mr/CFrIvknRYw2l+8Nv4dQY/IQtjuunic/Yv8o9oV0pSIgbvUqKaFwyyxNfU qmH105I4YqNjNqvX0k9IDraGFHTYHfkHCz9L8G8lojF/wpTi3F+giiEOOrkq1CRDgykC URxtKveIl2jVAFpgO01f47C1KTFbq047Z34AWWu9hkX4lM/eXq7nf125oDXGSNmWPGJk ZoZX+ySPFCd7+LhhJr38nF/lvOvnWsO5DCGTOfxZ9nqyjC/gDg6s5oSmfUDeLFuArpk+ pHERjO7Zi3IdpS76uOCWeseO8lAjlTf2Y5S+7p/VUKrz+hH7ypIo157uuzSp9Ehfeu8s NcGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hgulp4v1JuygJijQmY0syiHwA3rSjpoyiSS8vn/dFyo=; b=Q09vyxubi45k7HG0v2UEtxN8jl1eZUmWRtrKt6KRhxmCiRb12zOWckavg50fHY2eJI NHFbCCGqBao60ehNHzFte+3YQjajPgFiSEFDyMWW34kw7f/Luz8sbNlgFjoIyTN5UBlQ DGm0SktFKNG2xR27QM0n4nbO90oQUME/97KjYqWz8Af1FkDJ0ngcmK2yHRVxqEvAj8bj 0NGjw+19r4p2i9xXGLNVwAQNxdiqTepbRXAy+UU86fH1Aibsj4IYpBlL1AGlrrWok4Ba ++nwxDoN5P9PBxp3bbFJasHl+/3VUa6FCiH5ELTKYrdauwXsiCyGOi7MWlXtbftSqPI3 wW/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qzyfoVGP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4si10923123pfa.40.2019.02.12.05.50.34; Tue, 12 Feb 2019 05:50:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qzyfoVGP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729956AbfBLNuP (ORCPT + 99 others); Tue, 12 Feb 2019 08:50:15 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36049 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727428AbfBLNuP (ORCPT ); Tue, 12 Feb 2019 08:50:15 -0500 Received: by mail-pg1-f194.google.com with SMTP id r124so1294543pgr.3 for ; Tue, 12 Feb 2019 05:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hgulp4v1JuygJijQmY0syiHwA3rSjpoyiSS8vn/dFyo=; b=qzyfoVGPZDW+TzMUi9dsu/z8F3Phu6kjUB1Ey5dEJVIfYgWlpcTzEd1NHYjAXYRvSW CmlzYVqB5XSv71Q70onzLgtKqefCERaD1H/4l6qzeSPDUmqDMgdrPG/6e7L7BK7uhEsi UfU9sg7pzoNMlsvUiBZttnfxCA/vwzlV2E5gqDyDIYfOonahm1wLeRa/hFR3ehy+q6Xp B1+ii5Q93b+PMxzhNrOgVIFfnrbAuOxRWJUUUFLsLNRt6NnACEtEJX0IDuvlIhwhzf5O 9nIHrHsTNslBK9AakFUZPNt0Rfci5s2JAgvxVx5XPVR5JkBMmzXnac2lXHKvA/Dq6bdC VXcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hgulp4v1JuygJijQmY0syiHwA3rSjpoyiSS8vn/dFyo=; b=LOeEytIa68NwZTa1hsasm0VmpeetMK15gfnUramk/vGSAk0qq6Tpqz4Hwmuya71buq kgIrfd96q81Mbp4YBBCjWUHKiyfWuJfjMlkWdAnv7t+QrM9UpuXoMHj2RJvYS2++CtkG abtq9icPbhz9Nl3vqftQ4PxgIkO0fIsCNQnPsNLSlTlcubtX4Fik6Q+mMRxHeu5WGTyI z4OAYRKpaT7iyqRB6MfLexCC3tyxb/RH+ZlBNMDB+2Tm/BMueByOuylpwnf5+skeUuhA N+e25NFUorwbHD1OjrZHjy0YuzKxlCIoPFIWcDE5v0yxPViZjlUUSiW+gbdMGnmjaQp6 Rcxw== X-Gm-Message-State: AHQUAuZmIR4O3lNj4l6rD75IUw067//0cZpuSQZGsZbJ2xLMXttyqWW3 AJvJmQ/P51aW5tKlHJReXnsxDbupt8jARt57C9j7hWLa X-Received: by 2002:a63:4a21:: with SMTP id x33mr3838490pga.428.1549979414014; Tue, 12 Feb 2019 05:50:14 -0800 (PST) MIME-Version: 1.0 References: <20181022134048.19693-1-david.engraf@sysgo.com> <20181030151805.5519-1-david.engraf@sysgo.com> <20190208140810.76ef6c25825a5644d9625f0a@linux-foundation.org> <744e7bcb-9315-0283-67c5-c2cb2d094251@sysgo.com> <28139206-7fed-e00e-8f52-47e68655963d@sysgo.com> <84d387a3-0519-d50b-2c5d-98c10f694376@sysgo.com> In-Reply-To: From: Andy Shevchenko Date: Tue, 12 Feb 2019 15:50:03 +0200 Message-ID: Subject: Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs To: David Engraf Cc: Andrew Morton , Dominik Brodowski , Greg Kroah-Hartman , Philippe Ombredanne , Arnd Bergmann , Luc Van Oostenryck , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2019 at 2:12 PM David Engraf wrote: > On 12.02.19 at 11:43, Andy Shevchenko wrote: > > On Mon, Feb 11, 2019 at 2:40 PM David Engraf wrote: > >> On 11.02.19 at 12:40, Andy Shevchenko wrote: > >> Ok got it. When the memory behind the actual file size is clear (0x0) > >> the decompression doesn't complain and just ignores the padding. Any > >> other data will be interpreted as a new archive and thus you'll see the > >> error message. > > > > Correct. > > > >> Is it possible for you to fill the padding after the actual file size > >> with 0x00 ? > > > > Not sure. This is boot loader realm. Even if I patch U-Boot, not every > > boot loader will guarantee this. > > So, it's fragile to rely on data being 0x00 after actual archive. > > The problem is that the kernel expects another archive if there are data > left. If these data do not contain a valid magic the kernel prints an > error message which is correct. Agree. > I could make this error not critical and keep the rootfs, but it's still > an error and unexpected. I would rather call it a warning and continue. Perhaps something like static void warning(const char *msg) { ...print warning... return without assigning return value. } > You're using a modified bootloader which > reports a size larger than the file itself. This is not true. The size supplied by whatever user input through it command line or configuration. > Other bootloader will use > the file size and report the correct size to the kernel. This follows and thus not true either. It depends on boot loader completely. > So this > workaround is required by your setup only. So this is not true. > @Andrew: What do you think about that? Shall I create a workaround for > the special case? -- With Best Regards, Andy Shevchenko