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=-5.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 BFDD3C433ED for ; Tue, 27 Apr 2021 09:25:17 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42DCE6100B for ; Tue, 27 Apr 2021 09:25:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42DCE6100B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1lbJy0-00048g-3q for kernelnewbies@archiver.kernel.org; Tue, 27 Apr 2021 05:25:16 -0400 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1lbJvw-00025W-Fo for kernelnewbies@kernelnewbies.org; Tue, 27 Apr 2021 05:23:08 -0400 Received: by mail-il1-x12b.google.com with SMTP id l9so6490251ilh.10 for ; Tue, 27 Apr 2021 02:23:07 -0700 (PDT) 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=i9Ulj7jmTv9qGaBCRfQTI+hNPyZsIDunFfxpMivHPGU=; b=KOh0M8+A3MRxs9O+ghchsj04bgQu+RZD9xZAPI1HO0XthjUPCgPRGi5+l+Rah0MzjO F3btL+xW0WJqEG+34xVAVXkayTCI1Q/BxG19jlBkB3r7fItT7srND+xsCp/oPEXSTUiA k3FNqTt5BZoPUZSJ9lbDk9cdFwuFmFcfvPZqIhriOFf1lGXdFw9wTNDRFNPFBv5ij2n5 NZUxF7haHZ/7t7JlS559Ej29F8RUpX3ByL3KYtkNRk95DGgQ4kBqSKdp/b0qKw5nCtRc GnmBNaYEyPG8+WKbFq680bf2YlYTBRn58m0HS6UlmWvFV4BYk0+kLe+BvNbXoNbXZojW PUdg== 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=i9Ulj7jmTv9qGaBCRfQTI+hNPyZsIDunFfxpMivHPGU=; b=DWJQ8sjm6OAM6VdXo72xaY2qUk3zqAnLzK/9n01L/FjcSpcFE/UvFZYEZBxUVLEByv YMweo1R+VP9Q9D490HSZ+5oCI5KefOQLYb3cinRt5QB7o5MEQubDOUrc2FcFSYYrnmj5 pQniRQ6SAqtW3OgkxjJeAr1F56Qeb1NrEEX5c+L/ItQht9WaJyJAWJIvyvvogs+QdJ/K KMHENrXwxWoUscLtgYos63FfYWyxp8K7vco7BcDIXG13XuYWbwECKPNymexXAyrJCBZ0 wxlsAij9BqfuU+g+6iIlTOCtUgCdqfpcZy1Uvw9Lg8H69On1pJe4zvANn2jMzYcHAyqE jBcw== X-Gm-Message-State: AOAM530Jv/dHK5RFnxLZAEr69EISk2l1VX2H5xn08j6vjM6GtIC0NVYR D1BZ+8hjJPSWlt1Zbe/crAMe+ksKnqmHiE6rKlX+JYZvTGA= X-Google-Smtp-Source: ABdhPJxQI886kpmLizK2ibRWXbcNnOsV3oo5bQEChI+esq6J3w8G1kwDXmy7cZywBlozj0xRGdgCHJpzHfGWJ4e/gPI= X-Received: by 2002:a92:c548:: with SMTP id a8mr17270280ilj.137.1619515386765; Tue, 27 Apr 2021 02:23:06 -0700 (PDT) MIME-Version: 1.0 References: <6312af55.47e2.178d53227d0.Coremail.ouyangxuan10@163.com> <29d44208.9fc.178d85082a4.Coremail.ouyangxuan10@163.com> <32845770.3a85.179127be38c.Coremail.ouyangxuan10@163.com> In-Reply-To: <32845770.3a85.179127be38c.Coremail.ouyangxuan10@163.com> From: Amir Goldstein Date: Tue, 27 Apr 2021 12:22:55 +0300 Message-ID: Subject: Re: Re:Re: [kernel]:overlayfs: invalid origin (root/bmcweb_persistent_data.json, ftype=8000, origin ftype=4000) To: www Cc: kernelnewbies@kernelnewbies.org, Kevin Locke , overlayfs , Miklos Szeredi X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org On Tue, Apr 27, 2021 at 11:40 AM www wrote: > > Hi Amir, > > To solve this problem, we are trying to upgrade the kernel version or upgrade the file system separately, but because the kernel version we are using is quite different from the one that solves the problem. So I would like to ask you a few questions: > > 1. What is the root cause of this problem? As I wrote: I suppose lower squashfs was recreated and mounted with an existing upper dir that already contains upper files with origin references to the old squashfs lower fs. > > 2. Can we just upgrade overlay fs to solve this problem without upgrading the kernel or all file systems? > No. > 3. If we upgrade overlayfs separately, we are not very good at verifying that we have solved this problem, because the recurrence probability of this problem is very low. So I want to ask, how can we quickly reproduce this problem? Re-creating a lower squashfs after files have been copied to upper should reproduce the problem quite often. > > 4. Do you have any good suggestions? > Is the creation of the lower image under your control? Did you try the workaround I suggested to create lower squashfs with the "-no-exports" mksquashfs option? Try this patch: diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 71e264e2f16b..850c0a37f1f0 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -392,7 +392,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected, upperdentry, d_inode(upperdentry)->i_mode & S_IFMT, d_inode(origin)->i_mode & S_IFMT); dput(origin); - return -EIO; + return -EINVAL; } static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry, @@ -408,7 +408,7 @@ static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry, kfree(fh); if (err) { - if (err == -ESTALE) + if (err == -ESTALE || err == -EINVAL) return 0; return err; } It should apply to any kernel and if not it's quite easy to manually apply it. This fix will not get rid of the warning printed to kmsg, but it will hide the error from userspace. If it fixes your problem I think we should apply it to upstream and stable kernels as well. Thanks, Amir. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies