kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: www <ouyangxuan10@163.com>
Cc: kernelnewbies@kernelnewbies.org,
	Kevin Locke <kevin@kevinlocke.name>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: Re:Re: [kernel]:overlayfs: invalid origin (root/bmcweb_persistent_data.json, ftype=8000, origin ftype=4000)
Date: Tue, 27 Apr 2021 12:22:55 +0300	[thread overview]
Message-ID: <CAOQ4uxg=T+guwrikFBVUsf22Ckm4zPwZBO9GRycMVPR0M4dunQ@mail.gmail.com> (raw)
In-Reply-To: <32845770.3a85.179127be38c.Coremail.ouyangxuan10@163.com>

On Tue, Apr 27, 2021 at 11:40 AM www <ouyangxuan10@163.com> 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

      reply	other threads:[~2021-04-27  9:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6312af55.47e2.178d53227d0.Coremail.ouyangxuan10@163.com>
2021-04-15 17:09 ` [kernel]:overlayfs: invalid origin (root/bmcweb_persistent_data.json, ftype=8000, origin ftype=4000) Amir Goldstein
2021-04-16  1:34   ` www
2021-04-27  8:39     ` www
2021-04-27  9:22       ` Amir Goldstein [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOQ4uxg=T+guwrikFBVUsf22Ckm4zPwZBO9GRycMVPR0M4dunQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=kevin@kevinlocke.name \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=ouyangxuan10@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).